diff --git a/boards/default/micropython_esp32/config.json b/boards/default/micropython_esp32/config.json index 4b605ea1..5000ff60 100644 --- a/boards/default/micropython_esp32/config.json +++ b/boards/default/micropython_esp32/config.json @@ -20,25 +20,7 @@ }, "micropython:esp32:mpython": { "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/mPython-v1.23.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\"" - }, - "reset": [ - { - "dtr": false, - "rts": false - }, { - "sleep": 500 - }, { - "dtr": false, - "rts": true - }, { - "sleep": 500 - }, { - "dtr": false, - "rts": false - }, { - "sleep": 500 - } - ] + } }, "upload": { "type": "command", @@ -70,7 +52,7 @@ "yMin": 0, "pointNum": 100, "rts": false, - "dtr": false + "dtr": true }, "lib": { "mixly": { diff --git a/boards/default/micropython_esp32/main.bundle.js b/boards/default/micropython_esp32/main.bundle.js index 86c3dbb7..7780fbdc 100644 --- a/boards/default/micropython_esp32/main.bundle.js +++ b/boards/default/micropython_esp32/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Mt{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(lt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(lt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(lt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(lt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},xt={init:function(){this.setColour(Dt),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.PYTHON_RANGE).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Xt={init:function(){this.setColour(Dt),this.appendValueInput("LIST").setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(lt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return lt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bt={init:function(){this.setColour(Dt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new lt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(lt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:lt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:lt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},yt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new lt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Vt={init:function(){this.setColour(Dt);var t=new lt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:lt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:lt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Bt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new lt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return lt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new lt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return lt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};bt.OPERATORS=[[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Vt.OPERATORS=[[lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Ut={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},wt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(lt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Ht={init:function(){this.setColour(Dt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Wt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Kt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Jt={init:function(){this.jsonInit({message0:lt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Dt,tooltip:lt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:lt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Qt={init:function(){this.setColour(Dt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_STAT),this.setOutput(!0)}},qt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},zt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},jt={init:function(){this.appendDummyInput().appendField(lt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+lt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(lt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new lt.FieldDropdown([[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Dt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Zt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$t={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},te={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ee={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ie={init:function(){this.setColour(Dt),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(lt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ne=230;lt.FieldTextInput.math_number_validator=function(t){return String(t)},lt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const se={init:function(){this.setColour(ne),this.appendDummyInput().appendField(new lt.FieldTextInput("0",lt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MATH_NUMBER_TOOLTIP)}},oe={init:function(){this.setColour(ne);this.appendDummyInput("").appendField(lt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new lt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},_e={init:function(){this.setColour(ne);this.appendDummyInput("").appendField(lt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new lt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},pe={init:function(){this.setColour(ne),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:lt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:lt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:lt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ae={init:function(){this.setColour(ne),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:lt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:lt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:lt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ue={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new lt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},re={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new lt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:lt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:lt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:lt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:lt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:lt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:lt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:lt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},le={init:function(){var t=[[lt.Msg.MATH_BIN,"bin"],[lt.Msg.MATH_OCT,"oct"],[lt.Msg.MATH_HEX,"hex"]];this.setColour(ne),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new lt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:lt.Msg.MATH_DEC_TOOLTIP_BIN,oct:lt.Msg.MATH_DEC_TOOLTIP_OCT,hex:lt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},de={init:function(){var t=[[lt.Msg.LANG_MATH_TO_ROUND,"round"],[lt.Msg.LANG_MATH_TO_CEIL,"ceil"],[lt.Msg.LANG_MATH_TO_FLOOR,"floor"],[lt.Msg.MATH_ABS,"fabs"],[lt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ne),this.appendValueInput("A").setCheck(Number).appendField(new lt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:lt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:lt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:lt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:lt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:lt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:lt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ie={init:function(){var t=[[lt.Msg.MIXLY_MAX,"max"],[lt.Msg.MIXLY_MIN,"min"]];this.setColour(ne),this.appendValueInput("A").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(lt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:lt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:lt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Te={init:function(){var t=[[lt.Msg.MATH_TWO,"two"],[lt.Msg.MATH_EIGHT,"eight"],[lt.Msg.MATH_TEN,"ten"],[lt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ne),this.appendDummyInput("").appendField(lt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new lt.FieldDropdown(t),"OP").appendField(lt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MATH_ZHW).appendField(new lt.FieldDropdown(t),"OP2").appendField(lt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:lt.Msg.MATH_Before_two,eight:lt.Msg.MATH_Before_eight,ten:lt.Msg.MATH_Before_ten,sixteen:lt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:lt.Msg.MATH_Behind_two,eight:lt.Msg.MATH_Behind_eight,ten:lt.Msg.MATH_Behind_ten,sixteen:lt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Me={init:function(){var t=[[lt.Msg.LANG_MATH_INT,"int"],[lt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ne),this.setOutput(!0,Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new lt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:lt.Msg.LANG_MATH_INT,float:lt.Msg.LANG_MATH_FLOAT_RANDOM};return lt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},he={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(lt.Msg.MATH_CONSTRAIN_TOOLTIP)}},me={init:function(){this.setColour(ne),this.appendValueInput("NUM",Number).appendField(lt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(lt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(lt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Ee={init:function(){this.setColour(ne),this.appendDummyInput().appendField(new lt.FieldTextInput("0",lt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(lt.Msg.MATH_NUMBER_TOOLTIP)}},Oe={init:function(){this.setColour(ne),this.appendValueInput("NUM").setCheck(Number).appendField(lt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Re={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MATH_ROUND).appendField(lt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(lt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(lt.Msg.MATH_ROUND_NEW_TOOLTIP)}},ce={init:function(){var t=[[lt.Msg.MIXLY_TO_INT,"int"],[lt.Msg.MIXLY_TO_FLOAT,"float"],[lt.Msg.MIXLY_TO_BITES,"b"],[lt.Msg.LANG_MATH_BYTE+lt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ne),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:lt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:lt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:lt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ge={init:function(){var t=[[lt.Msg.MIXLY_TO_INT,"int"],[lt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ne),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:lt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:lt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Ce=me,Se={init:function(){this.setColour(ne),this.appendValueInput("VAR").appendField(lt.Msg.LANG_MATH_BYTE+lt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ae={init:function(){this.setColour(ne),this.itemCount_=1,this.setMutator(new lt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(lt.Msg.MIXLY_PRODUCT+lt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(lt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(lt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(lt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const fe={init:function(){this.setColour(Le),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new lt.FieldTextInput("",lt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(lt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new lt.FieldImage(e,7,12,'"')}},Fe={init:function(){this.setColour(Le),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(lt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Pe={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},ve={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(String).appendField(lt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Ye={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},xe={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Xe={init:function(){this.WHERE_OPTIONS=[[lt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[lt.Msg.TEXT_GET_INDEX_RANDOM+1+lt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.LISTS_GET_INDEX_GET,"MODE"),lt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(lt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+lt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",lt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:lt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:lt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:lt.Msg.TEXT_GET_INDEX_RANDOM};return lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+lt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==lt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),lt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(lt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new lt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),lt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},be={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(lt.Msg.LISTS_GET_INDEX_GET+" "+lt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(lt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+lt.Msg.LISTS_GET_INDEX_FROM_START+"n"+lt.Msg.TEXT_CHARAT2)}},ye={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(lt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(lt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ve={init:function(){this.WHERE_OPTIONS_1=[[lt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[lt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[lt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[lt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(lt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==lt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==lt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),lt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(lt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new lt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Be={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(lt.Msg.LISTS_GET_INDEX_GET+" "+lt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(lt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(lt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(lt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ge={init:function(){var t=[[lt.Msg.MIXLY_EQUALS,"==="],[lt.Msg.MIXLY_STARTSWITH,"startswith"],[lt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Le),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new lt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ue={init:function(){this.setColour(Le),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(lt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_COMPARETO_HELP)}},we={init:function(){var t=[[lt.Msg.TEXT_UPPER,"upper"],[lt.Msg.TEXT_TITLE,"title"],[lt.Msg.TEXT_CAPITALIZE,"capitalize"],[lt.Msg.TEXT_SWAPCASE,"swapcase"],[lt.Msg.TEXT_LOWER,"lower"]];this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new lt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:lt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:lt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:lt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:lt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:lt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ke={init:function(){var t=[[lt.Msg.TEXT_LJUST,"ljust"],[lt.Msg.TEXT_CENTER,"center"],[lt.Msg.TEXT_RJUST,"rjust"]];this.setColour(Le),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(lt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(lt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},He={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(lt.Msg.MIXLY_MID+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(lt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},We={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ke={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(lt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(lt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Je={init:function(){this.setColour(Le),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(lt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(lt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Qe={init:function(){var t=[[lt.Msg.TEXT_TRIM_BOTH,"strip"],[lt.Msg.TEXT_TRIM_LEFT,"lstrip"],[lt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Le),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(lt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(lt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:lt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:lt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:lt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},qe={init:function(){this.setColour(Le),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new lt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new lt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hi={init:function(){this.setColour(wi),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Wi={init:function(){this.setColour(wi),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ki={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_KEYS),this.setTooltip(lt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ji={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(lt.Msg.DICTS_GET_TOOLTIP)}},Qi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(lt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(lt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},qi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(lt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},zi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_DELETE_TOOLTIP)}},ji={init:function(){this.setColour(wi),this.appendValueInput("DICT2").setCheck("Dict").appendField(lt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(lt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MID),this.setTooltip(lt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_CLEAR),this.setTooltip(lt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_ITEMS),this.setTooltip(lt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},tn={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_VALUES),this.setTooltip(lt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_LENGTH),this.setTooltip(lt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},nn={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_DELDICT),this.setTooltip(lt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sn={init:function(){this.MODE=[[lt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[lt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(lt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=lt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=lt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==lt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new lt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},on={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.setTooltip(lt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},_n={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(lt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},pn={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new lt.FieldLabel(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new lt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},an={init:function(){this.setColour(wi),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},un={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TO_JSON),this.setTooltip(lt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},rn={init:function(){this.setColour(wi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(lt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ln={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dn=210,In={init:function(){var t=lt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:lt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:lt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:lt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:lt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:lt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:lt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Tn={init:function(){var t=lt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=lt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new lt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Mn={init:function(){var t=[[lt.Msg.LOGIC_OPERATION_AND,"AND"],[lt.Msg.LOGIC_OPERATION_OR,"OR"],[lt.Msg.LOGIC_OPERATION_NOR,"NOR"],[lt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new lt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:lt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:lt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:lt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:lt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},hn={init:function(){this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(lt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(lt.Msg.LOGIC_NEGATE_TOOLTIP)}},mn={init:function(){var t=[[lt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[lt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new lt.FieldDropdown(t),"BOOL"),this.setTooltip(lt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},En={init:function(){this.setColour(dn),this.setOutput(!0),this.appendDummyInput().appendField(lt.Msg.LOGIC_NULL),this.setTooltip(lt.Msg.LOGIC_NULL_TOOLTIP)}},On={init:function(){this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(lt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(lt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Rn={init:function(){var t=[[lt.Msg.TEXT_APPEND_TO,"in"],[lt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new lt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(lt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.IN)}},cn={init:function(){var t=[[lt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[lt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},gn={init:function(){this.setColour(dn),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Cn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(lt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},An={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG,_=lt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(lt.Msg.MIXPY_TEXT_ENCODE).appendField(new lt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG,_=lt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Nn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},fn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(lt.Msg.MICROBIT_PYTHON_TYPE)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.HTML_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},xn={init:function(){this.setColour(0),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Xn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Bn={init:function(){this.setColour(0),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Gn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+lt.Msg.MIXLY_ESP32_SET+{mkdir:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(lt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.HTML_FILE,"isfile"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Hn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(lt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(lt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Kn={};Kn.NAME_TYPE=lt.PROCEDURE_CATEGORY_NAME,Kn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(lt.Msg.MIXLY_AIP_ATTR).setAlign(lt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ws={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_FORM_CONTENT).appendField(new lt.FieldDropdown([[lt.Msg.HTML_TEXT,"text"],[lt.Msg.HTML_EMAIL,"email"],[lt.Msg.HTML_NUMBER,"number"],[lt.Msg.HTML_PASSWORD,"password"],[lt.Msg.HTML_CHECKBOX,"checkbox"],[lt.Msg.HTML_RADIOBUTTON,"radiobutton"],[lt.Msg.HTML_BUTTON,"button"],[lt.Msg.HTML_COLOUR,"colour"],[lt.Msg.HTML_DATE,"date"],[lt.Msg.HTML_LOCALTIME,"local time"],[lt.Msg.HTML_FILE,"file"],[lt.Msg.HTML_HIDDEN,"hidden"],[lt.Msg.HTML_IMAGE,"image"],[lt.Msg.HTML_MONTH,"month"],[lt.Msg.HTML_RANGE,"range"],[lt.Msg.HTML_RESET,"reset"],[lt.Msg.HTML_SEARCH,"search"],[lt.Msg.HTML_SUBMIT,"submit"],[lt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[lt.Msg.HTML_TIME,"time"],[lt.Msg.HTML_URL,"url"],[lt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(lt.Msg.HTML_NAME).appendField(new lt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(lt.Msg.HTML_VALUE).appendField(new lt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(lt.Msg.MIXLY_AIP_ATTR).setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(new lt.FieldTextInput("property"),"KEY").appendField(":").appendField(new lt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(new lt.FieldTextInput("property"),"KEY").appendField(":").appendField(new lt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_TEXT).appendField(new lt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks=160,Js={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new lt.FieldTable(""),"TEXT")}},Qs={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new lt.FieldMultilineInput(""),"TEXT")}},qs={init:function(){this.setColour(Ks),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new lt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},zs={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},js={init:function(){this.setColour(Ks),this.appendDummyInput().appendTitle("Comment:").appendTitle(new lt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Zs={init:function(){this.setColour(Ks),this.appendValueInput("VALUE").appendField(lt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},$s={init:function(){this.setColour(Ks),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new lt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(lt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=lt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},lt.isNumber(n)&<.isNumber(s)&<.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const kp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Hp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Wp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Kp=function(t,e){return["None",e.ORDER_ATOMIC]},Jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Qp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},qp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},zp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},jp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Zp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},$p=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ta=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ia=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},na=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},sa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},oa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},_a=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},pa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},aa=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ua=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ra=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},da=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ia=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ma=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Ea=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),lt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},tu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},eu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},iu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},nu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},su=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},ou=function(t,e){return'"},_u=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},pu=function(){return this.getFieldValue("TEXT")+"\n"},au=function(t){return t.getFieldValue("TEXT")+"\n"},uu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},ru=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},lu=function(){return""},du=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Iu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Mu.scrubNakedValue=function(t){return t+"\n"},Mu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Mu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Mu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=lt.utils.string.wrap(o,Mu.COMMENT_WRAP-3),n+=Mu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const hu="#74A55B",mu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(lt.Msg.MIXLY_RGB_PIN_COUNT)}},Eu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Ou={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ru={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},cu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(lt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(lt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},gu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Cu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Su={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Au={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Lu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Nu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Du={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},fu={init:function(){this.setColour(hu),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Fu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Pu={init:function(){this.setColour(hu),this.appendValueInput("VAR").appendField("360°"+lt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SETTING+lt.Msg.blockpy_turtle_rotate+lt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},vu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Yu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},xu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},bu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new lt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(lt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},yu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[lt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[lt.Msg.MOTOR_N,"ms32006.MOT_N"],[lt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Vu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new lt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[lt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Bu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(lt.Msg.MIXLY_RGB_PIN_COUNT)}},Gu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Uu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},wu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_WRI)}},ku={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new lt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+lt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Hu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Wu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Ku={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(lt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},Ju={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(lt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(lt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Qu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},qu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},zu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},ju={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LISTS_SET_INDEX_SET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_WHITE,"W"],[lt.Msg.COLOUR_RGB_RED,"R"],[lt.Msg.COLOUR_RGB_YELLOW,"Y"],[lt.Msg.COLOUR_RGB_GREEN,"G"],[lt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$u={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_WHITE,"W"],[lt.Msg.COLOUR_RGB_RED,"R"],[lt.Msg.COLOUR_RGB_YELLOW,"Y"],[lt.Msg.COLOUR_RGB_GREEN,"G"],[lt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},tr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[lt.Msg.MIXLY_SPEED,"[1]"],[lt.Msg.MATH_SINGLE_OP_ABSOLUTE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[lt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[lt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[lt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},er={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ir={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MATH_SINGLE_OP_ABSOLUTE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"0"],[lt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[lt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},sr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField("("+lt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},_r={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField("("+lt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"0"],[lt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MOTOR,"ext_motor"],[lt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[lt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[lt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[lt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[lt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[lt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[lt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},ar={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MOTOR,"ext_motor"],[lt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[lt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[lt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[lt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[lt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[lt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[lt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur="#6C9858",rr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},lr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_ON,"1"],[lt.Msg.MIXLY_ESP32_OFF,"0"],[lt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},dr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Ir={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Tr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Mr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_BUILDIN_LED+lt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},hr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(lt.Msg.MIXLY_LCD_SETCOLOR).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LIGHT_RED,"1"],[lt.Msg.MIXLY_LIGHT_GREEN,"2"],[lt.Msg.MIXLY_LIGHT_BLUE,"3"],[lt.Msg.MIXLY_LIGHT_YELLOW,"4"],[lt.Msg.MIXLY_LIGHT_CYAN,"5"],[lt.Msg.MIXLY_LIGHT_PURPLE,"6"],[lt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},mr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Er={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Or={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_BUILDIN_LED+lt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},cr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},gr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(dt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Cr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Sr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Ar={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.PYTHON_RANGE_STEP).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Lr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Nr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(dt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Dr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},fr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.PYTHON_RANGE_STEP).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Fr={init:function(){this.setColour(ur),this.appendValueInput("TICKS").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(lt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(lt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Pr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},vr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Yr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},xr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Xr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},br={init:function(){this.setColour(ur),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},yr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Vr={init:function(){this.setColour(ur),this.appendDummyInput().appendField("MixGo Car").appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Br={init:function(){this.setColour(ur),this.appendDummyInput("").appendField("MixGo Car").appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Gr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([[lt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[lt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ur={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([[lt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[lt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_STOP).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},kr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[lt.Msg.MIXLY_SPEED,"SPEED"],[lt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Hr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.MIXLY_MOTOR).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"1"],[lt.Msg.TEXT_TRIM_RIGHT,"2"],[lt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[lt.Msg.MIXLY_SPEED,"SPEED"],[lt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Kr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[lt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(lt.Msg.MIXLY_MOTOR).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"0"],[lt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(ur),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},jr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Zr={init:function(){this.setColour(ur),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_MIXBOT_BUZZER+lt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},$r={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MIXBOT_BUZZER+lt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},tl={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_RECORD_AUDIO).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(lt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_PLAY_AUDIO).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},il={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},nl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},sl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ol={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.LISTS_SET_INDEX_SET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},_l={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT+lt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},pl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.LISTS_SET_INDEX_SET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.MIXLY_ALL+lt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(lt.ALIGN_RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT+lt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},al={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.ANALOG+lt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(lt.Msg.MIXLY_RELEASE).appendField(new lt.FieldDropdown([[lt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[lt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.ANALOG+lt.Msg.MIXLY_KEYBOARD_INPUT)}},ul={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SPECIAL_KEY).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[lt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[lt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[lt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[lt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[lt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[lt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[lt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[lt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},rl={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GENERAL_KEY).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ll={init:function(){this.setColour(ur),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new lt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(lt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Rm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},cm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},gm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Cm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(lt.Msg.MIXLY_WIFI_USERNAME).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(lt.Msg.MIXLY_IOT_PASSWORD).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(lt.Msg.MIXLY_EMQX_PROJECT).setAlign(lt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(lt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(lt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Am={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(lt.Msg.MIXLY_EMQX_SUBSCRIBE+lt.Msg.MIXLY_MICROBIT_MSG).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(lt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Lm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(lt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Fm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Pm={init:function(){this.setColour(Im),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},vm={init:function(){this.setColour(Im),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Ym={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},xm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO").appendField(lt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(lt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Xm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+lt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ym={init:function(){this.VISITOR_ID=dt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Im),this.appendDummyInput("").appendField(new lt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Vm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO").appendField(lt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("HTTP"+lt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(lt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(lt.Msg.MIXLY_REQUESTS_GET).appendField(lt.Msg.MIXLY_GET_CURRENT_TIME).appendField(lt.Msg.MIXLY_OPEN_DEBUG).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("HTTP"+lt.Msg.MIXLY_Client).appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[lt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[lt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Um={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MQTT"+lt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(lt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(lt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(lt.Msg.MQTT_Topic).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(lt.Msg.MIXLY_OPEN_DEBUG).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MQTT"+lt.Msg.MIXLY_Client).appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[lt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[lt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},km=Tm,Hm=Mm,Wm=hm,Km=mm,Jm=Om,Qm=225,qm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(lt.Msg.MIXLY_NETWORK_MODE).appendField(new lt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},zm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[lt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=lt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:lt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:lt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},jm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},Zm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return lt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:lt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},$m={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(lt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(lt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},tE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_CONNECT+lt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},eE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[lt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[lt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:lt.Msg.MIXLY_ESP32_NETWORK_IP,1:lt.Msg.MIXLY_ESP32_NETWORK_MASK,2:lt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},iE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},nE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[lt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},sE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(lt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(lt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},oE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},_E={init:function(){this.setColour(Qm),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new lt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},pE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},aE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},uE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},rE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},lE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},dE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},IE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},TE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},ME={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},hE={init:function(){this.setColour(Qm),this.appendValueInput("DOMAIN").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_REQUESTS_GET).appendField(new lt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mE={init:function(){this.appendValueInput("VAL");var t=[[lt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:lt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:lt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:lt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},EE={init:function(){this.appendValueInput("VAR").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(lt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:lt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:lt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},OE={init:function(){this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(lt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},RE={init:function(){this.setColour(Qm),this.appendDummyInput("").appendField(new lt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},cE="#3288dd",gE={init:function(){this.setColour(cE),this.appendValueInput("URL").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(lt.Msg.blockpy_REQUESTS).appendField(lt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},CE={init:function(){this.setColour(cE),this.appendValueInput("URL").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(lt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(lt.Msg.blockpy_REQUESTS+lt.Msg.OLED_STRING),this.appendDummyInput("").appendField(lt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},SE={init:function(){this.appendValueInput("VAL");var t=[[lt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[lt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(cE),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},AE=100,LE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("I2CSUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},NE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},DE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(lt.Msg.MOTOR_DC).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},fE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(lt.Msg.MOTOR_DC).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},FE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},PE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},vE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+lt.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},YE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},xE="#A58C5B",XE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(lt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SENOR_IS_PRESSED)}},bE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(lt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SENOR_WAS_PRESSED)}},yE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_BUTTON+lt.Msg.MIXLY_GET_PRESSES)}},VE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[lt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[lt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},BE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_shake,"shake"],[lt.Msg.MIXLY_UP,"up"],[lt.Msg.MIXLY_DOWN,"down"],[lt.Msg.MIXLY_LEFT,"left"],[lt.Msg.MIXLY_RIGHT,"right"],[lt.Msg.MIXLY_MICROBIT_face_up,"face up"],[lt.Msg.MIXLY_MICROBIT_face_down,"face down"],[lt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=lt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=lt.Msg.MSG.catSensor,s=lt.Msg.MIXLY_MICROBIT_JS_STATE,o=lt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:lt.Msg.MIXLY_MICROBIT_shake,up:lt.Msg.MIXLY_UP,down:lt.Msg.MIXLY_DOWN,left:lt.Msg.MIXLY_LEFT,right:lt.Msg.MIXLY_RIGHT,"face up":lt.Msg.MIXLY_MICROBIT_face_up,"face down":lt.Msg.MIXLY_MICROBIT_face_down,freefall:lt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},GE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},UE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},wE={init:function(){var t=[[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(xE),this.appendValueInput("PIN",Number).appendField(new lt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new lt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},kE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},HE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},WE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"left"],[lt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(lt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=lt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=lt.Msg.MIXLY_ESP32_NEAR;return i+{left:lt.Msg.TEXT_TRIM_LEFT,right:lt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},KE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[lt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":lt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":lt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},JE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[lt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},QE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},qE={init:function(){this.setColour(xE),this.appendDummyInput("").appendField("LM35"+lt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_LM35)}},zE={init:function(){this.setColour(xE),this.appendValueInput("I2CSUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new lt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},jE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[lt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[lt.Msg.MIXLY_ESP32_MAX30102_IR+","+lt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[lt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[lt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},$E={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},tO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.HTML_COLOUR+lt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET+lt.Msg.HTML_COLOUR,"[2]"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_IR_STRENGTH,"[1]"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},eO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.HTML_COLOUR+lt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET+"RGB"+lt.Msg.HTML_COLOUR,"0"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_RGB_RAW,"1"],[lt.Msg.MIXLY_GET_ENV_LIGHT+lt.Msg.MIXLY_BRIGHTNESS,"2"],[lt.Msg.GET_IR_STRENGTH+lt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},iO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[lt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},nO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},sO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},oO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},_O={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_Altitude+lt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETPRESSURE,"pressure()"],[lt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[lt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_Altitude+lt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETPRESSURE,"pressure()"],[lt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[lt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MIXGOPE_FIELD+lt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[lt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_shake,"shake"],[lt.Msg.MIXLY_UP,"up"],[lt.Msg.MIXLY_DOWN,"down"],[lt.Msg.MIXLY_LEFT,"left"],[lt.Msg.MIXLY_RIGHT,"right"],[lt.Msg.MIXLY_MICROBIT_face_up,"face up"],[lt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=lt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=lt.Msg.MSG.catSensor,s=lt.Msg.MIXLY_MICROBIT_JS_STATE,o=lt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:lt.Msg.MIXLY_MICROBIT_shake,up:lt.Msg.MIXLY_UP,down:lt.Msg.MIXLY_DOWN,left:lt.Msg.MIXLY_LEFT,right:lt.Msg.MIXLY_RIGHT,"face up":lt.Msg.MIXLY_MICROBIT_face_up,"face down":lt.Msg.MIXLY_MICROBIT_face_down}[e]+o}))}},rO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},lO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_GET+lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},dO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+lt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},IO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},TO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_GETTEMPERATUE)}},MO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return lt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},hO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},mO={init:function(){this.setColour(xE),this.appendValueInput("SPISUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new lt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},EO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[lt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},OO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},RO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},cO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(lt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},gO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(lt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(lt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},CO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RFID_SCAN_OK,"0"],[lt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[lt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},SO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},AO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},NO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new lt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&o)):(2048<=o&&o<=55295||57344<=o&&o<=65535)&&(n+=3,i.push(224|15&o>>12),i.push(128|63&o>>6),i.push(128|63&o))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==_?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+o+",font_address="+p+")\n"):"16x8 Matrix"==_&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+o+")\n"),i},TN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},MN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},hN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},mN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},EN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ON=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},RN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},cN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},gN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},CN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},SN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},AN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},LN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},NN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},DN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},fN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},FN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},PN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},vN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),_=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+o+", "+_+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+o+", "+_+","+a+")\n"}},YN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},xN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},XN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},bN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},yN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},VN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),_="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(_){case"True":return i+".show_fill_circle("+n+", "+s+", "+o+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+o+", "+p+")\n"}},BN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),_=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n"}},GN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},UN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},wN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},kN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},HN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},WN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},KN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},JN=function(t,e){e.definitions_.import_st7789="import st7789";var i=dt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+o+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+_+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},QN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},qN=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},zN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},jN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},ZN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},$N=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},tD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),o=e.valueToCode(this,"x2",e.ORDER_ATOMIC),_=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+o+", "+_+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+o+", "+_+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},eD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),o=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+o+")\n"},iD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},nD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},oD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},_D=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),o=dt.Boards.getSelectedBoardKey().split(":")[2],_="";return _=["mpython","mixgo_pe","mixgo_nova"].indexOf(o)>=0?"0x700000":["mixgo_zero"].indexOf(o)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+_+")\n"},pD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},aD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},uD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},rD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},lD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},TD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},MD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},hD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},mD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},ED=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},OD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+o+", "+_+", "+p+")\n"+i+".show()\n"},RD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\n"+i+".show()\n"},cD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},gD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},CD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),o=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+o+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+o+")\n")},SD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},AD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},LD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},ND=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},DD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},fD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},FD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let o="",_=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),_+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);o+=n(_.toString(16)),s.unshift(o)}let o=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},uf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},rf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},lf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},df=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},If=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},Tf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},Mf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==_.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},hf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),o=e.valueToCode(t,"x2",e.ORDER_ATOMIC),_=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},mf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},Ef=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},Of=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},Rf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var _="onboard_tft.pixel(int("+n+"), int("+s+"), "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return _},cf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},gf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},Cf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},Sf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=_+"=Clock("+n+","+s+","+o+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=_+"=Clock("+n+","+s+","+o+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Af=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},Lf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},Nf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},Df=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var o=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o=n+".clear(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\n"}return o},ff=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"r",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==_.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", "+_+","+p+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Ff=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Pf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},vf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},Yf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},bx=function(){return"control.reset()\n"},yx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||dt.Profile.default.serial)+")\n"},Vx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||dt.Profile.default.serial)+")\n"},Bx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Gx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Ux=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},wx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},kx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Hx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Wx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Kx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Jx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Qx=function(){return"while True:\n pass\n"},qx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},zx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},jx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Zx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},$x=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},tX=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},eX=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},iX=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},nX=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},sX=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},oX=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},_X=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},pX=iX,aX=tX,uX=eX,rX=jx,lX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},IX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},TX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},MX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},hX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},mX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},EX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},OX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},RX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},cX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},gX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},CX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},SX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},AX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},LX={};LX["MixGo(ESP32, 4M)"]={description:"MicroPython[ESP32 MixGo]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX["MixGo PE"]={description:"MicroPython[ESP32 MixGo PE]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin7","pin7"],["pin8","pin8"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm7","pwm7"],["pwm8","pwm8"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"],["pwm33","pwm33"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:dt.Profile.generate(["0-7"]),exlcdv:dt.Profile.generate(["0-4"]),brightness:dt.Profile.generate(["0-9"]),tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX["ESP32 Generic"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin11","pin11"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX.mPython={description:"MicroPython[ESP32 Generic]",digital_pin:[["p0","33"],["p1","32"],["p2","35"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],digital:[["pin0","pin33"],["pin1","pin32"],["pin2","pin35"],["pin5","pin0"],["pin6","pin16"],["pin7","pin17"],["pin8","pin26"],["pin9","pin25"],["pin11","pin2"],["pin13","pin18"],["pin14","pin19"],["pin15","pin21"],["pin16","pin5"],["pin19","pin22"],["pin20","pin23"]],input_pin:[["p0","33"],["p1","32"],["p2","35"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],output_pin:[["p0","33"],["p1","32"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],pwm_pin:[["p0","33"],["p1","32"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],pwm:[["pwm0","pwm33"],["pwm1","pwm32"],["pwm5","pwm0"],["pwm6","pwm16"],["pwm7","pwm17"],["pwm8","pwm26"],["pwm9","pwm25"],["pwm11","pwm2"],["pwm13","pwm18"],["pwm14","pwm19"],["pwm15","pwm21"],["pwm16","pwm5"],["pwm19","pwm22"],["pwm20","pwm23"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),analog_pin:[["p0","33"],["p1","32"],["p2","35"],["p3","34"],["p4","39"],["p10","36"]],analog:[["adc0","adc33"],["adc1","adc32"],["adc2","adc35"],["adc3","adc34"],["adc4","adc39"],["adc10","adc36"]],dac_pin:[["p8","26"],["p9","25"]],dac:[["dac8","dac26"],["dac9","dac25"]],touch_mpython:[["p","p"],["y","y"],["t","t"],["h","h"],["o","o"],["n","n"]],touch:[["tc0","tc33"],["tc1","tc32"],["tc5","tc0"],["tc11","tc2"],["tc23","tc27"],["tc24","tc14"],["tc25","tc12"],["tc26","tc13"],["tc27","tc15"],["tc28","tc4"]],touch_pin:[["p0","33"],["p1","32"],["p5","0"],["p11","2"],["p23","27"],["p24","14"],["p25","12"],["p26","13"],["p27","15"],["p28","4"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]};const NX=LX,DX=230,fX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital),"PIN"),this.setOutput(!0)}},FX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},PX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},vX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},YX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch_mpython),"PIN"),this.setOutput(!0,Number)}},xX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},XX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},bX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},yX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},VX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},BX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},GX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},UX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},wX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},kX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},HX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},WX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},KX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog),"PIN"),this.setOutput(!0)}},JX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},QX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.dac),"PIN"),this.setOutput(!0)}},qX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},zX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},jX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},ZX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},$X={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch),"PIN"),this.setOutput(!0)}},eb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},nb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},sb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},ob={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},_b={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},pb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},ub={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},db={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Tb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},hb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},Eb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},Ob=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Rb=Ob,cb=Ob,gb=Ob,Cb=Ob,Sb=Ob,Ab=Ob,Lb=Ob,Nb=Ob,Db=Ob,fb=Ob,Fb=Ob,Pb=Ob,vb=Ob,Yb=Ob,xb=Ob,Xb=Ob,bb=Ob,yb=Ob,Vb=Ob,Bb=Ob,Gb=Ob,Ub=Ob,wb=Ob,kb=Ob,Hb=Ob,Wb=Ob,Kb=Ob,Jb=Ob,Qb=Ob,qb=Ob,zb=Ob,jb=Ob,Zb=Ob,$b=Ob;Object.assign(lt.Variables,Tt),Object.assign(lt.Procedures,Jn),lt.Python=Mu,lt.generator=Mu,dt.Profile.default={},Object.assign(dt.Profile,NX),Object.assign(dt.Profile.default,NX["ESP32 Generic"]),Object.assign(lt.Blocks,e,i,n,s,o,_,p,a,u,r,l,d,I,b,k,w,v,y,H,f,U,G,B,V,F,D,N,x,Y,X,P,ut),Object.assign(lt.Python.forBlock,T,M,h,m,E,O,R,c,g,C,S,A,L,tt,pt,_t,z,et,at,J,ot,st,nt,it,Q,K,W,Z,j,$,q,rt)})(); \ No newline at end of file +class Mt{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(lt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(lt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(lt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(lt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},xt={init:function(){this.setColour(Dt),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.PYTHON_RANGE).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Xt={init:function(){this.setColour(Dt),this.appendValueInput("LIST").setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(lt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return lt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bt={init:function(){this.setColour(Dt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new lt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(lt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:lt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:lt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},yt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new lt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(lt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Vt={init:function(){this.setColour(Dt);var t=new lt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:lt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:lt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Bt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new lt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return lt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new lt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return lt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};bt.OPERATORS=[[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Vt.OPERATORS=[[lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[lt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Ut={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},wt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(lt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Ht={init:function(){this.setColour(Dt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Wt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Kt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(lt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Jt={init:function(){this.jsonInit({message0:lt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Dt,tooltip:lt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:lt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Qt={init:function(){this.setColour(Dt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_STAT),this.setOutput(!0)}},qt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},zt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},jt={init:function(){this.appendDummyInput().appendField(lt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+lt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(lt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new lt.FieldDropdown([[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[lt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Dt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Zt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$t={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},te={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ee={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ie={init:function(){this.setColour(Dt),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(lt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ne=230;lt.FieldTextInput.math_number_validator=function(t){return String(t)},lt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const se={init:function(){this.setColour(ne),this.appendDummyInput().appendField(new lt.FieldTextInput("0",lt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MATH_NUMBER_TOOLTIP)}},oe={init:function(){this.setColour(ne);this.appendDummyInput("").appendField(lt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new lt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},_e={init:function(){this.setColour(ne);this.appendDummyInput("").appendField(lt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new lt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:lt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},pe={init:function(){this.setColour(ne),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:lt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:lt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:lt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ae={init:function(){this.setColour(ne),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:lt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:lt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:lt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:lt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:lt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ue={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new lt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},re={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new lt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:lt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:lt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:lt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:lt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:lt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:lt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:lt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},le={init:function(){var t=[[lt.Msg.MATH_BIN,"bin"],[lt.Msg.MATH_OCT,"oct"],[lt.Msg.MATH_HEX,"hex"]];this.setColour(ne),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new lt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:lt.Msg.MATH_DEC_TOOLTIP_BIN,oct:lt.Msg.MATH_DEC_TOOLTIP_OCT,hex:lt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},de={init:function(){var t=[[lt.Msg.LANG_MATH_TO_ROUND,"round"],[lt.Msg.LANG_MATH_TO_CEIL,"ceil"],[lt.Msg.LANG_MATH_TO_FLOOR,"floor"],[lt.Msg.MATH_ABS,"fabs"],[lt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ne),this.appendValueInput("A").setCheck(Number).appendField(new lt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:lt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:lt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:lt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:lt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:lt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:lt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ie={init:function(){var t=[[lt.Msg.MIXLY_MAX,"max"],[lt.Msg.MIXLY_MIN,"min"]];this.setColour(ne),this.appendValueInput("A").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(lt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:lt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:lt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Te={init:function(){var t=[[lt.Msg.MATH_TWO,"two"],[lt.Msg.MATH_EIGHT,"eight"],[lt.Msg.MATH_TEN,"ten"],[lt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ne),this.appendDummyInput("").appendField(lt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new lt.FieldDropdown(t),"OP").appendField(lt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MATH_ZHW).appendField(new lt.FieldDropdown(t),"OP2").appendField(lt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:lt.Msg.MATH_Before_two,eight:lt.Msg.MATH_Before_eight,ten:lt.Msg.MATH_Before_ten,sixteen:lt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:lt.Msg.MATH_Behind_two,eight:lt.Msg.MATH_Behind_eight,ten:lt.Msg.MATH_Behind_ten,sixteen:lt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Me={init:function(){var t=[[lt.Msg.LANG_MATH_INT,"int"],[lt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ne),this.setOutput(!0,Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new lt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(lt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:lt.Msg.LANG_MATH_INT,float:lt.Msg.LANG_MATH_FLOAT_RANDOM};return lt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},he={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(lt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(lt.Msg.MATH_CONSTRAIN_TOOLTIP)}},me={init:function(){this.setColour(ne),this.appendValueInput("NUM",Number).appendField(lt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(lt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(lt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Ee={init:function(){this.setColour(ne),this.appendDummyInput().appendField(new lt.FieldTextInput("0",lt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(lt.Msg.MATH_NUMBER_TOOLTIP)}},Oe={init:function(){this.setColour(ne),this.appendValueInput("NUM").setCheck(Number).appendField(lt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Re={init:function(){this.setColour(ne),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MATH_ROUND).appendField(lt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(lt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(lt.Msg.MATH_ROUND_NEW_TOOLTIP)}},ce={init:function(){var t=[[lt.Msg.MIXLY_TO_INT,"int"],[lt.Msg.MIXLY_TO_FLOAT,"float"],[lt.Msg.MIXLY_TO_BITES,"b"],[lt.Msg.LANG_MATH_BYTE+lt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ne),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:lt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:lt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:lt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ge={init:function(){var t=[[lt.Msg.MIXLY_TO_INT,"int"],[lt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ne),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:lt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:lt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Ce=me,Se={init:function(){this.setColour(ne),this.appendValueInput("VAR").appendField(lt.Msg.LANG_MATH_BYTE+lt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ae={init:function(){this.setColour(ne),this.itemCount_=1,this.setMutator(new lt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(lt.Msg.MIXLY_PRODUCT+lt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(lt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(lt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(lt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const fe={init:function(){this.setColour(Le),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new lt.FieldTextInput("",lt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(lt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new lt.FieldImage(e,7,12,'"')}},Fe={init:function(){this.setColour(Le),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(lt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Pe={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},ve={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(String).appendField(lt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Ye={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},xe={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Xe={init:function(){this.WHERE_OPTIONS=[[lt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[lt.Msg.TEXT_GET_INDEX_RANDOM+1+lt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.LISTS_GET_INDEX_GET,"MODE"),lt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(lt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=lt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+lt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",lt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:lt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:lt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:lt.Msg.TEXT_GET_INDEX_RANDOM};return lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+lt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==lt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),lt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(lt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new lt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),lt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},be={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(lt.Msg.LISTS_GET_INDEX_GET+" "+lt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(lt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+lt.Msg.LISTS_GET_INDEX_FROM_START+"n"+lt.Msg.TEXT_CHARAT2)}},ye={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(lt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(lt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ve={init:function(){this.WHERE_OPTIONS_1=[[lt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[lt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[lt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[lt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[lt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(lt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==lt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==lt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),lt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(lt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new lt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Be={init:function(){this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(lt.Msg.LISTS_GET_INDEX_GET+" "+lt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(lt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(lt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(lt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ge={init:function(){var t=[[lt.Msg.MIXLY_EQUALS,"==="],[lt.Msg.MIXLY_STARTSWITH,"startswith"],[lt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Le),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new lt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ue={init:function(){this.setColour(Le),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(lt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_COMPARETO_HELP)}},we={init:function(){var t=[[lt.Msg.TEXT_UPPER,"upper"],[lt.Msg.TEXT_TITLE,"title"],[lt.Msg.TEXT_CAPITALIZE,"capitalize"],[lt.Msg.TEXT_SWAPCASE,"swapcase"],[lt.Msg.TEXT_LOWER,"lower"]];this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new lt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:lt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:lt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:lt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:lt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:lt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ke={init:function(){var t=[[lt.Msg.TEXT_LJUST,"ljust"],[lt.Msg.TEXT_CENTER,"center"],[lt.Msg.TEXT_RJUST,"rjust"]];this.setColour(Le),this.appendValueInput("VAR").appendField(new lt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(lt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(lt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},He={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(lt.Msg.MIXLY_MID+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(lt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},We={init:function(){this.setColour(Le),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ke={init:function(){this.setColour(Le),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(lt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(lt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Je={init:function(){this.setColour(Le),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(lt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(lt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Qe={init:function(){var t=[[lt.Msg.TEXT_TRIM_BOTH,"strip"],[lt.Msg.TEXT_TRIM_LEFT,"lstrip"],[lt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Le),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(lt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new lt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(lt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:lt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:lt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:lt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},qe={init:function(){this.setColour(Le),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new lt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new lt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hi={init:function(){this.setColour(wi),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Wi={init:function(){this.setColour(wi),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ki={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_KEYS),this.setTooltip(lt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ji={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(lt.Msg.DICTS_GET_TOOLTIP)}},Qi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(lt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(lt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},qi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(lt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},zi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(lt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_DELETE_TOOLTIP)}},ji={init:function(){this.setColour(wi),this.appendValueInput("DICT2").setCheck("Dict").appendField(lt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(lt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MID),this.setTooltip(lt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_CLEAR),this.setTooltip(lt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_ITEMS),this.setTooltip(lt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},tn={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_VALUES),this.setTooltip(lt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_LENGTH),this.setTooltip(lt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},nn={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.DICT_DELDICT),this.setTooltip(lt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sn={init:function(){this.MODE=[[lt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[lt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(lt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(lt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=lt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=lt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==lt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new lt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},on={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(lt.Msg.DICTS_ADD_VALUE),this.setTooltip(lt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},_n={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(lt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(lt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},pn={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new lt.FieldLabel(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new lt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},an={init:function(){this.setColour(wi),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},un={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TO_JSON),this.setTooltip(lt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},rn={init:function(){this.setColour(wi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(lt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ln={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dn=210,In={init:function(){var t=lt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:lt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:lt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:lt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:lt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:lt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:lt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Tn={init:function(){var t=lt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=lt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new lt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Mn={init:function(){var t=[[lt.Msg.LOGIC_OPERATION_AND,"AND"],[lt.Msg.LOGIC_OPERATION_OR,"OR"],[lt.Msg.LOGIC_OPERATION_NOR,"NOR"],[lt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new lt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:lt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:lt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:lt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:lt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},hn={init:function(){this.setColour(dn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(lt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(lt.Msg.LOGIC_NEGATE_TOOLTIP)}},mn={init:function(){var t=[[lt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[lt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(dn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new lt.FieldDropdown(t),"BOOL"),this.setTooltip(lt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},En={init:function(){this.setColour(dn),this.setOutput(!0),this.appendDummyInput().appendField(lt.Msg.LOGIC_NULL),this.setTooltip(lt.Msg.LOGIC_NULL_TOOLTIP)}},On={init:function(){this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(lt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(lt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Rn={init:function(){var t=[[lt.Msg.TEXT_APPEND_TO,"in"],[lt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new lt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(lt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.IN)}},cn={init:function(){var t=[[lt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[lt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new lt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},gn={init:function(){this.setColour(dn),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(lt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Cn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(lt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},An={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG,_=lt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(lt.Msg.MIXPY_TEXT_ENCODE).appendField(new lt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_USE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=lt.Msg.MIXLY_BELONG,_=lt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Nn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+lt.Msg.MIXLY_MICROBIT_TYPE_STRING+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},fn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(lt.Msg.MICROBIT_PYTHON_TYPE)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.HTML_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},xn={init:function(){this.setColour(0),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Xn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Bn={init:function(){this.setColour(0),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Gn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return lt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+lt.Msg.MIXLY_ESP32_SET+{mkdir:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(lt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.HTML_FILE,"isfile"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+lt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Hn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(lt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(lt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Kn={};Kn.NAME_TYPE=lt.PROCEDURE_CATEGORY_NAME,Kn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(lt.Msg.MIXLY_AIP_ATTR).setAlign(lt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ws={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_FORM_CONTENT).appendField(new lt.FieldDropdown([[lt.Msg.HTML_TEXT,"text"],[lt.Msg.HTML_EMAIL,"email"],[lt.Msg.HTML_NUMBER,"number"],[lt.Msg.HTML_PASSWORD,"password"],[lt.Msg.HTML_CHECKBOX,"checkbox"],[lt.Msg.HTML_RADIOBUTTON,"radiobutton"],[lt.Msg.HTML_BUTTON,"button"],[lt.Msg.HTML_COLOUR,"colour"],[lt.Msg.HTML_DATE,"date"],[lt.Msg.HTML_LOCALTIME,"local time"],[lt.Msg.HTML_FILE,"file"],[lt.Msg.HTML_HIDDEN,"hidden"],[lt.Msg.HTML_IMAGE,"image"],[lt.Msg.HTML_MONTH,"month"],[lt.Msg.HTML_RANGE,"range"],[lt.Msg.HTML_RESET,"reset"],[lt.Msg.HTML_SEARCH,"search"],[lt.Msg.HTML_SUBMIT,"submit"],[lt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[lt.Msg.HTML_TIME,"time"],[lt.Msg.HTML_URL,"url"],[lt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(lt.Msg.HTML_NAME).appendField(new lt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(lt.Msg.HTML_VALUE).appendField(new lt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(lt.Msg.MIXLY_AIP_ATTR).setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(new lt.FieldTextInput("property"),"KEY").appendField(":").appendField(new lt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(new lt.FieldTextInput("property"),"KEY").appendField(":").appendField(new lt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Xs),this.appendDummyInput().appendField(lt.Msg.HTML_TEXT).appendField(new lt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks=160,Js={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new lt.FieldTable(""),"TEXT")}},Qs={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new lt.FieldMultilineInput(""),"TEXT")}},qs={init:function(){this.setColour(Ks),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new lt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},zs={init:function(){this.setColour(Ks),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},js={init:function(){this.setColour(Ks),this.appendDummyInput().appendTitle("Comment:").appendTitle(new lt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Zs={init:function(){this.setColour(Ks),this.appendValueInput("VALUE").appendField(lt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},$s={init:function(){this.setColour(Ks),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new lt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(lt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=lt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},lt.isNumber(n)&<.isNumber(s)&<.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const kp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Hp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Wp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Kp=function(t,e){return["None",e.ORDER_ATOMIC]},Jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Qp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},qp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},zp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},jp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Zp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},$p=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ta=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ia=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},na=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},sa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},oa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},_a=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},pa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},aa=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ua=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ra=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},da=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ia=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ma=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Ea=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),lt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},tu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},eu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},iu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},nu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},su=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},ou=function(t,e){return'"},_u=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},pu=function(){return this.getFieldValue("TEXT")+"\n"},au=function(t){return t.getFieldValue("TEXT")+"\n"},uu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},ru=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},lu=function(){return""},du=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Iu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Mu.scrubNakedValue=function(t){return t+"\n"},Mu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Mu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Mu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=lt.utils.string.wrap(o,Mu.COMMENT_WRAP-3),n+=Mu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const hu="#74A55B",mu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(lt.Msg.MIXLY_RGB_PIN_COUNT)}},Eu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Ou={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ru={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},cu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(lt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(lt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},gu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Cu={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Su={init:function(){this.setColour(hu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Au={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Lu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Nu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Du={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},fu={init:function(){this.setColour(hu),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Fu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Pu={init:function(){this.setColour(hu),this.appendValueInput("VAR").appendField("360°"+lt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SETTING+lt.Msg.blockpy_turtle_rotate+lt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},vu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Yu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},xu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(hu),this.appendValueInput("PIN",Number).appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},bu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new lt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(lt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},yu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[lt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[lt.Msg.MOTOR_N,"ms32006.MOT_N"],[lt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Vu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new lt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[lt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Bu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(lt.Msg.MIXLY_RGB_PIN_COUNT)}},Gu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Uu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},wu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_WRI)}},ku={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new lt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+lt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Hu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Wu={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Ku={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(lt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},Ju={init:function(){this.setColour(hu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(lt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(lt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(lt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Qu={init:function(){this.setColour(hu),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},qu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},zu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},ju={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.LISTS_SET_INDEX_SET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[lt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zu={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_WHITE,"W"],[lt.Msg.COLOUR_RGB_RED,"R"],[lt.Msg.COLOUR_RGB_YELLOW,"Y"],[lt.Msg.COLOUR_RGB_GREEN,"G"],[lt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$u={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_WHITE,"W"],[lt.Msg.COLOUR_RGB_RED,"R"],[lt.Msg.COLOUR_RGB_YELLOW,"Y"],[lt.Msg.COLOUR_RGB_GREEN,"G"],[lt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},tr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[lt.Msg.MIXLY_SPEED,"[1]"],[lt.Msg.MATH_SINGLE_OP_ABSOLUTE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[lt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[lt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[lt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},er={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[lt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ir={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MATH_SINGLE_OP_ABSOLUTE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"0"],[lt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[lt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},sr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField("("+lt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},_r={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.ME_GO_MOTOR_EXTERN+lt.Msg.MIXLY_SERVO_MOTOR).appendField(lt.Msg.MIXLY_RELATIVE+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+lt.Msg.MSG.run).appendField("("+lt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LEFT,"0"],[lt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MODE).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPEED+lt.Msg.MIXLY_MODE,"0"],[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+lt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(lt.inputs.Align.RIGHT).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"0"],[lt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MOTOR,"ext_motor"],[lt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[lt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[lt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[lt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[lt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[lt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[lt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},ar={init:function(){this.setColour(hu),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.ME_GO_MOTOR_EXTERN).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MOTOR,"ext_motor"],[lt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[lt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[lt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[lt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[lt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[lt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[lt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur="#6C9858",rr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},lr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_ON,"1"],[lt.Msg.MIXLY_ESP32_OFF,"0"],[lt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},dr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Ir={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Tr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Mr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_BUILDIN_LED+lt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},hr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(lt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(lt.Msg.MIXLY_LCD_SETCOLOR).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_LIGHT_RED,"1"],[lt.Msg.MIXLY_LIGHT_GREEN,"2"],[lt.Msg.MIXLY_LIGHT_BLUE,"3"],[lt.Msg.MIXLY_LIGHT_YELLOW,"4"],[lt.Msg.MIXLY_LIGHT_CYAN,"5"],[lt.Msg.MIXLY_LIGHT_PURPLE,"6"],[lt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},mr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Er={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(lt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Or={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(lt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_SETTING).appendField(lt.Msg.MIXLY_BUILDIN_LED).appendField(new lt.FieldDropdown([[lt.Msg.COLOUR_RGB_RED,"r"],[lt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_BUILDIN_LED+lt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},cr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(new lt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},gr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(dt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Cr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Sr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Ar={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.PYTHON_RANGE_STEP).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Lr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Nr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(dt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(lt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Dr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(lt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},fr={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(lt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.PYTHON_RANGE_STEP).appendField(lt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Fr={init:function(){this.setColour(ur),this.appendValueInput("TICKS").setCheck(Number).appendField(lt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(lt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(lt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Pr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},vr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Yr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},xr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(lt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Xr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},br={init:function(){this.setColour(ur),this.appendValueInput("LIST").appendField(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},yr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Vr={init:function(){this.setColour(ur),this.appendDummyInput().appendField("MixGo Car").appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Br={init:function(){this.setColour(ur),this.appendDummyInput("").appendField("MixGo Car").appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Gr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([[lt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[lt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ur={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MOTOR_DC).appendField(new lt.FieldDropdown([[lt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[lt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_STOP).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},kr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[lt.Msg.MIXLY_SPEED,"SPEED"],[lt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Hr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXBOT).appendField(lt.Msg.MIXLY_MOTOR).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"1"],[lt.Msg.TEXT_TRIM_RIGHT,"2"],[lt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[lt.Msg.MIXLY_SPEED,"SPEED"],[lt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Kr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[lt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(new lt.FieldDropdown([[lt.Msg.blockpy_forward,"F"],[lt.Msg.blockpy_backward,"B"],[lt.Msg.blockpy_left,"L"],[lt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(new lt.FieldDropdown([[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.BITBOT).appendField(lt.Msg.MIXLY_MOTOR).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"0"],[lt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(ur),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},jr={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Zr={init:function(){this.setColour(ur),this.appendValueInput("bright").appendField(lt.Msg.MIXLY_SETTING+lt.Msg.MIXLY_MIXBOT_BUZZER+lt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_SETONOFF)}},$r={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MIXBOT_BUZZER+lt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_LED_GETONOFF)}},tl={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_RECORD_AUDIO).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(lt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_PLAY_AUDIO).appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},il={init:function(){this.setColour(ur),this.appendValueInput("PATH").appendField(lt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},nl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(lt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},sl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ol={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.LISTS_SET_INDEX_SET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},_l={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.PIN_NUMBERING).appendField(new lt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT+lt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},pl={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.LISTS_SET_INDEX_SET+lt.Msg.ME_GO_MOTOR_EXTERN).appendField(lt.Msg.MIXLY_ALL+lt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(lt.ALIGN_RIGHT).appendField(lt.Msg.blynk_IOT_IR_POWER+lt.Msg.MIXLY_PINMODEOUT+lt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},al={init:function(){this.setColour(ur),this.appendDummyInput().appendField(lt.Msg.ANALOG+lt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(lt.Msg.MIXLY_RELEASE).appendField(new lt.FieldDropdown([[lt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[lt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.ANALOG+lt.Msg.MIXLY_KEYBOARD_INPUT)}},ul={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SPECIAL_KEY).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[lt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[lt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[lt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[lt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[lt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[lt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[lt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[lt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},rl={init:function(){this.setColour(ur),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GENERAL_KEY).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ll={init:function(){this.setColour(ur),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new lt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(lt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Rm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},cm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},gm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Cm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(lt.Msg.MIXLY_WIFI_USERNAME).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(lt.Msg.MIXLY_IOT_PASSWORD).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(lt.Msg.MIXLY_EMQX_PROJECT).setAlign(lt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(lt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(lt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Am={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(lt.Msg.MIXLY_EMQX_SUBSCRIBE+lt.Msg.MIXLY_MICROBIT_MSG).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(lt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Lm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(lt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Fm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(lt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Pm={init:function(){this.setColour(Im),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},vm={init:function(){this.setColour(Im),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Ym={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(lt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},xm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO").appendField(lt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(lt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Xm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+lt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bm={init:function(){this.setColour(Im),this.appendDummyInput().appendField(lt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(lt.Msg.MIXLY_EMQX_SERVER).setAlign(lt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(lt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ym={init:function(){this.VISITOR_ID=dt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Im),this.appendDummyInput("").appendField(new lt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Vm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MixIO").appendField(lt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("HTTP"+lt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(lt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(lt.Msg.MIXLY_REQUESTS_GET).appendField(lt.Msg.MIXLY_GET_CURRENT_TIME).appendField(lt.Msg.MIXLY_OPEN_DEBUG).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("HTTP"+lt.Msg.MIXLY_Client).appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[lt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[lt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Um={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MQTT"+lt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(lt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(lt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(lt.Msg.MQTT_Topic).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(lt.Msg.MIXLY_OPEN_DEBUG).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[lt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wm={init:function(){this.setColour(Im),this.appendDummyInput().appendField("MQTT"+lt.Msg.MIXLY_Client).appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[lt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[lt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},km=Tm,Hm=Mm,Wm=hm,Km=mm,Jm=Om,Qm=225,qm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(lt.Msg.MIXLY_NETWORK_MODE).appendField(new lt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},zm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[lt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=lt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:lt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:lt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},jm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},Zm={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return lt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:lt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},$m={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(lt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(lt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},tE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_NETWORK_WIFI_CONNECT+lt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},eE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[lt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[lt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:lt.Msg.MIXLY_ESP32_NETWORK_IP,1:lt.Msg.MIXLY_ESP32_NETWORK_MASK,2:lt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},iE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},nE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[lt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},sE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(lt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(lt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},oE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(lt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},_E={init:function(){this.setColour(Qm),this.appendValueInput("VAR").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new lt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},pE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},aE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},uE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},rE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},lE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},dE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},IE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},TE={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},ME={init:function(){this.setColour(Qm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},hE={init:function(){this.setColour(Qm),this.appendValueInput("DOMAIN").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_REQUESTS_GET).appendField(new lt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){lt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mE={init:function(){this.appendValueInput("VAL");var t=[[lt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:lt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:lt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:lt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},EE={init:function(){this.appendValueInput("VAR").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(lt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:lt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:lt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},OE={init:function(){this.setColour(Qm),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(lt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},RE={init:function(){this.setColour(Qm),this.appendDummyInput("").appendField(new lt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},cE="#3288dd",gE={init:function(){this.setColour(cE),this.appendValueInput("URL").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(lt.Msg.blockpy_REQUESTS).appendField(lt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},CE={init:function(){this.setColour(cE),this.appendValueInput("URL").appendField(lt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(lt.Msg.blockpy_CONDUCT).appendField(new lt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(lt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(lt.Msg.blockpy_REQUESTS+lt.Msg.OLED_STRING),this.appendDummyInput("").appendField(lt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},SE={init:function(){this.appendValueInput("VAL");var t=[[lt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[lt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[lt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(cE),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},AE=100,LE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("I2CSUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},NE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},DE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(lt.Msg.MOTOR_DC).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Direction).appendField(new lt.FieldDropdown([[lt.Msg.CLOCKWISE,"CW"],[lt.Msg.ANTI_CLOCKWISE,"CCW"],[lt.Msg.MOTOR_P,"P"],[lt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},fE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(lt.Msg.MOTOR_DC).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},FE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_MOVE)}},PE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(lt.inputs.Align.RIGHT).appendField(lt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},vE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+lt.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},YE={init:function(){var t=dt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(AE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+lt.Msg.MIXLY_SERVO).appendField(lt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET+lt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},xE="#A58C5B",XE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(lt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SENOR_IS_PRESSED)}},bE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(lt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_SENOR_WAS_PRESSED)}},yE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(lt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.PROCEDURES_DEFRETURN_RETURN+lt.Msg.MIXLY_BUTTON+lt.Msg.MIXLY_GET_PRESSES)}},VE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_BUTTON).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MODE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[lt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[lt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},BE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_shake,"shake"],[lt.Msg.MIXLY_UP,"up"],[lt.Msg.MIXLY_DOWN,"down"],[lt.Msg.MIXLY_LEFT,"left"],[lt.Msg.MIXLY_RIGHT,"right"],[lt.Msg.MIXLY_MICROBIT_face_up,"face up"],[lt.Msg.MIXLY_MICROBIT_face_down,"face down"],[lt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(lt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=lt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=lt.Msg.MSG.catSensor,s=lt.Msg.MIXLY_MICROBIT_JS_STATE,o=lt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:lt.Msg.MIXLY_MICROBIT_shake,up:lt.Msg.MIXLY_UP,down:lt.Msg.MIXLY_DOWN,left:lt.Msg.MIXLY_LEFT,right:lt.Msg.MIXLY_RIGHT,"face up":lt.Msg.MIXLY_MICROBIT_face_up,"face down":lt.Msg.MIXLY_MICROBIT_face_down,freefall:lt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},GE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},UE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},wE={init:function(){var t=[[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(xE),this.appendValueInput("PIN",Number).appendField(new lt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new lt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:lt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},kE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},HE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},WE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new lt.FieldDropdown([[lt.Msg.TEXT_TRIM_LEFT,"left"],[lt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(lt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=lt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=lt.Msg.MIXLY_ESP32_NEAR;return i+{left:lt.Msg.TEXT_TRIM_LEFT,right:lt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},KE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[lt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":lt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":lt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},JE={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[lt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},QE={init:function(){this.setColour(xE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},qE={init:function(){this.setColour(xE),this.appendDummyInput("").appendField("LM35"+lt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(lt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(lt.Msg.MIXLY_TOOLTIP_LM35)}},zE={init:function(){this.setColour(xE),this.appendValueInput("I2CSUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new lt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},jE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[lt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[lt.Msg.MIXLY_ESP32_MAX30102_IR+","+lt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZE={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[lt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[lt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},$E={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},tO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.HTML_COLOUR+lt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET+lt.Msg.HTML_COLOUR,"[2]"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_IR_STRENGTH,"[1]"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},eO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.HTML_COLOUR+lt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET+"RGB"+lt.Msg.HTML_COLOUR,"0"],[lt.Msg.MIXLY_GET+lt.Msg.MIXLY_RGB_RAW,"1"],[lt.Msg.MIXLY_GET_ENV_LIGHT+lt.Msg.MIXLY_BRIGHTNESS,"2"],[lt.Msg.GET_IR_STRENGTH+lt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},iO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[lt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},nO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},sO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},oO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[lt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:lt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},_O={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_Altitude+lt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETPRESSURE,"pressure()"],[lt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[lt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_Altitude+lt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_GETPRESSURE,"pressure()"],[lt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[lt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MIXGOPE_FIELD+lt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[lt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_shake,"shake"],[lt.Msg.MIXLY_UP,"up"],[lt.Msg.MIXLY_DOWN,"down"],[lt.Msg.MIXLY_LEFT,"left"],[lt.Msg.MIXLY_RIGHT,"right"],[lt.Msg.MIXLY_MICROBIT_face_up,"face up"],[lt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=lt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=lt.Msg.MSG.catSensor,s=lt.Msg.MIXLY_MICROBIT_JS_STATE,o=lt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:lt.Msg.MIXLY_MICROBIT_shake,up:lt.Msg.MIXLY_UP,down:lt.Msg.MIXLY_DOWN,left:lt.Msg.MIXLY_LEFT,right:lt.Msg.MIXLY_RIGHT,"face up":lt.Msg.MIXLY_MICROBIT_face_up,"face down":lt.Msg.MIXLY_MICROBIT_face_down}[e]+o}))}},rO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},lO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_GET+lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},dO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+lt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new lt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=lt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=lt.Msg.MIXLY_MICROBIT_Direction,s=lt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":lt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},IO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},TO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_GETTEMPERATUE)}},MO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return lt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:lt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:lt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},hO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(lt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(lt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},mO={init:function(){this.setColour(xE),this.appendValueInput("SPISUB").appendField(lt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(lt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SETUP+lt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new lt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},EO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[lt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},OO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},RO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"+lt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},cO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(lt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},gO={init:function(){this.setColour(xE),this.appendDummyInput().appendField(lt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(lt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(lt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(lt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},CO={init:function(){this.setColour(xE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new lt.FieldDropdown([[lt.Msg.MIXLY_RFID_SCAN_OK,"0"],[lt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[lt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},SO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new lt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},AO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(lt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},NO={init:function(){this.setColour(xE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new lt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&o)):(2048<=o&&o<=55295||57344<=o&&o<=65535)&&(n+=3,i.push(224|15&o>>12),i.push(128|63&o>>6),i.push(128|63&o))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==_?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+o+",font_address="+p+")\n"):"16x8 Matrix"==_&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+o+")\n"),i},TN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},MN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},hN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},mN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},EN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ON=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},RN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},cN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},gN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},CN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},SN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},AN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},LN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},NN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},DN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},fN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},FN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},PN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},vN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),_=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+o+", "+_+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+o+", "+_+","+a+")\n"}},YN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},xN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},XN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},bN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},yN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},VN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),_="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(_){case"True":return i+".show_fill_circle("+n+", "+s+", "+o+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+o+", "+p+")\n"}},BN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),_=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n"}},GN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},UN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},wN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},kN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},HN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},WN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},KN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},JN=function(t,e){e.definitions_.import_st7789="import st7789";var i=dt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+o+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+_+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},QN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},qN=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},zN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},jN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},ZN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},$N=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},tD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),o=e.valueToCode(this,"x2",e.ORDER_ATOMIC),_=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+o+", "+_+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+o+", "+_+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},eD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),o=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+o+")\n"},iD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},nD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},oD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},_D=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),o=dt.Boards.getSelectedBoardKey().split(":")[2],_="";return _=["mpython","mixgo_pe","mixgo_nova"].indexOf(o)>=0?"0x700000":["mixgo_zero"].indexOf(o)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+_+")\n"},pD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},aD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},uD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},rD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},lD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},TD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},MD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},hD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},mD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},ED=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},OD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+o+", "+_+", "+p+")\n"+i+".show()\n"},RD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\n"+i+".show()\n"},cD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},gD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},CD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),o=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+o+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+o+")\n")},SD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},AD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},LD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},ND=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},DD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},fD=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},FD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let o="",_=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),_+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);o+=n(_.toString(16)),s.unshift(o)}let o=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},uf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},rf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},lf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},df=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},If=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},Tf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},Mf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==_.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},hf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),o=e.valueToCode(t,"x2",e.ORDER_ATOMIC),_=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},mf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},Ef=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},Of=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},Rf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var _="onboard_tft.pixel(int("+n+"), int("+s+"), "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return _},cf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},gf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},Cf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},Sf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=_+"=Clock("+n+","+s+","+o+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=_+"=Clock("+n+","+s+","+o+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Af=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},Lf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},Nf=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},Df=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var o=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o=n+".clear(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\n"}return o},ff=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"r",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==_.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", "+_+","+p+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Ff=function(t,e){var i=dt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Pf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},vf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},Yf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},bx=function(){return"control.reset()\n"},yx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||dt.Profile.default.serial)+")\n"},Vx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||dt.Profile.default.serial)+")\n"},Bx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||dt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Gx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Ux=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},wx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},kx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Hx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Wx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Kx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Jx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Qx=function(){return"while True:\n pass\n"},qx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},zx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},jx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Zx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},$x=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},tX=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},eX=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},iX=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},nX=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},sX=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},oX=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},_X=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},pX=iX,aX=tX,uX=eX,rX=jx,lX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},IX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},TX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},MX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},hX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},mX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},EX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},OX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},RX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},cX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},gX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},CX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},SX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},AX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},LX={};LX["MixGo(ESP32, 4M)"]={description:"MicroPython[ESP32 MixGo]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX["MixGo PE"]={description:"MicroPython[ESP32 MixGo PE]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin7","pin7"],["pin8","pin8"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm7","pwm7"],["pwm8","pwm8"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"],["pwm33","pwm33"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:dt.Profile.generate(["0-7"]),exlcdv:dt.Profile.generate(["0-4"]),brightness:dt.Profile.generate(["0-9"]),tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX["ESP32 Generic"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin11","pin11"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},LX.mPython={description:"MicroPython[ESP32 Generic]",digital_pin:[["p0","33"],["p1","32"],["p2","35"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],digital:[["pin0","pin33"],["pin1","pin32"],["pin2","pin35"],["pin5","pin0"],["pin6","pin16"],["pin7","pin17"],["pin8","pin26"],["pin9","pin25"],["pin11","pin2"],["pin13","pin18"],["pin14","pin19"],["pin15","pin21"],["pin16","pin5"],["pin19","pin22"],["pin20","pin23"]],input_pin:[["p0","33"],["p1","32"],["p2","35"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],output_pin:[["p0","33"],["p1","32"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],pwm_pin:[["p0","33"],["p1","32"],["p5","0"],["p6","16"],["p7","17"],["p8","26"],["p9","25"],["p11","2"],["p13","18"],["p14","19"],["p15","21"],["p16","5"],["p19","22"],["p20","23"]],pwm:[["pwm0","pwm33"],["pwm1","pwm32"],["pwm5","pwm0"],["pwm6","pwm16"],["pwm7","pwm17"],["pwm8","pwm26"],["pwm9","pwm25"],["pwm11","pwm2"],["pwm13","pwm18"],["pwm14","pwm19"],["pwm15","pwm21"],["pwm16","pwm5"],["pwm19","pwm22"],["pwm20","pwm23"]],espnow_channel:dt.Profile.generate(["1-13"]),haskylens_model:dt.Profile.generate(["0-4"]),analog_pin:[["p0","33"],["p1","32"],["p2","35"],["p3","34"],["p4","39"],["p10","36"]],analog:[["adc0","adc33"],["adc1","adc32"],["adc2","adc35"],["adc3","adc34"],["adc4","adc39"],["adc10","adc36"]],dac_pin:[["p8","26"],["p9","25"]],dac:[["dac8","dac26"],["dac9","dac25"]],touch_mpython:[["p","p"],["y","y"],["t","t"],["h","h"],["o","o"],["n","n"]],touch:[["tc0","tc33"],["tc1","tc32"],["tc5","tc0"],["tc11","tc2"],["tc23","tc27"],["tc24","tc14"],["tc25","tc12"],["tc26","tc13"],["tc27","tc15"],["tc28","tc4"]],touch_pin:[["p0","33"],["p1","32"],["p5","0"],["p11","2"],["p23","27"],["p24","14"],["p25","12"],["p26","13"],["p27","15"],["p28","4"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:dt.Profile.generate(["0-16"]),tts_builtin_music:dt.Profile.generate(["0-47"]),tts_bgmusic:dt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]};const NX=LX,DX=230,fX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital),"PIN"),this.setOutput(!0)}},FX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},PX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},vX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},YX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch_mpython),"PIN"),this.setOutput(!0,Number)}},xX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},XX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},bX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},yX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},VX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},BX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},GX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},UX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},wX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},kX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},HX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},WX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},KX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog),"PIN"),this.setOutput(!0)}},JX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},QX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.dac),"PIN"),this.setOutput(!0)}},qX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},zX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},jX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},ZX={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},$X={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.touch),"PIN"),this.setOutput(!0)}},eb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},nb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},sb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},ob={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},_b={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},pb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},ub={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},db={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Tb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},hb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},Eb={init:function(){this.setColour(DX),this.appendDummyInput("").appendField(new lt.FieldDropdown(dt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},Ob=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Rb=Ob,cb=Ob,gb=Ob,Cb=Ob,Sb=Ob,Ab=Ob,Lb=Ob,Nb=Ob,Db=Ob,fb=Ob,Fb=Ob,Pb=Ob,vb=Ob,Yb=Ob,xb=Ob,Xb=Ob,bb=Ob,yb=Ob,Vb=Ob,Bb=Ob,Gb=Ob,Ub=Ob,wb=Ob,kb=Ob,Hb=Ob,Wb=Ob,Kb=Ob,Jb=Ob,Qb=Ob,qb=Ob,zb=Ob,jb=Ob,Zb=Ob,$b=Ob;Object.assign(lt.Variables,Tt),Object.assign(lt.Procedures,Jn),lt.Python=Mu,lt.generator=Mu,dt.Profile.default={},Object.assign(dt.Profile,NX),Object.assign(dt.Profile.default,NX["ESP32 Generic"]),Object.assign(lt.Blocks,e,i,n,s,o,_,p,a,u,r,l,d,I,b,k,w,v,y,H,f,U,G,B,V,F,D,N,x,Y,X,P,ut),Object.assign(lt.Python.forBlock,T,M,h,m,E,O,R,c,g,C,S,A,L,tt,pt,_t,z,et,at,J,ot,st,nt,it,Q,K,W,Z,j,$,q,rt)})(); \ No newline at end of file diff --git a/boards/default/micropython_esp32c2/main.bundle.js b/boards/default/micropython_esp32c2/main.bundle.js index d05f30f7..a0318a34 100644 --- a/boards/default/micropython_esp32c2/main.bundle.js +++ b/boards/default/micropython_esp32c2/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Et.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Et.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Et.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Et.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},wt={init:function(){this.setColour(yt),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.PYTHON_RANGE).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},kt={init:function(){this.setColour(yt),this.appendValueInput("LIST").setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Et.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ht={init:function(){this.setColour(yt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Et.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Et.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Et.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Et.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Wt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Et.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Kt={init:function(){this.setColour(yt);var t=new Et.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Et.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Et.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Jt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Et.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Et.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},qt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Et.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Et.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Ht.OPERATORS=[[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Kt.OPERATORS=[[Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},jt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Et.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},$t={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},te={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},ee={init:function(){this.jsonInit({message0:Et.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:yt,tooltip:Et.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Et.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ie={init:function(){this.setColour(yt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_STAT),this.setOutput(!0)}},ne={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},se={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},_e={init:function(){this.appendDummyInput().appendField(Et.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Et.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Et.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Et.FieldDropdown([[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(yt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},oe={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pe={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},ae={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ue={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_GET_UNIQUE_IDEN)}},re={init:function(){this.setColour(yt),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Et.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},le=230;Et.FieldTextInput.math_number_validator=function(t){return String(t)},Et.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const de={init:function(){this.setColour(le),this.appendDummyInput().appendField(new Et.FieldTextInput("0",Et.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MATH_NUMBER_TOOLTIP)}},Ie={init:function(){this.setColour(le);this.appendDummyInput("").appendField(Et.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Et.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Te={init:function(){this.setColour(le);this.appendDummyInput("").appendField(Et.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Et.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Me={init:function(){this.setColour(le),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Et.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Et.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Et.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},he={init:function(){this.setColour(le),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Et.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Et.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Et.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},me={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Et.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Oe={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Et.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Et.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Et.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Et.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Et.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Et.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Et.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Et.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Ee={init:function(){var t=[[Et.Msg.MATH_BIN,"bin"],[Et.Msg.MATH_OCT,"oct"],[Et.Msg.MATH_HEX,"hex"]];this.setColour(le),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Et.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Et.Msg.MATH_DEC_TOOLTIP_BIN,oct:Et.Msg.MATH_DEC_TOOLTIP_OCT,hex:Et.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Re={init:function(){var t=[[Et.Msg.LANG_MATH_TO_ROUND,"round"],[Et.Msg.LANG_MATH_TO_CEIL,"ceil"],[Et.Msg.LANG_MATH_TO_FLOOR,"floor"],[Et.Msg.MATH_ABS,"fabs"],[Et.Msg.MATH_SQRT,"sqrt"]];this.setColour(le),this.appendValueInput("A").setCheck(Number).appendField(new Et.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Et.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Et.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Et.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Et.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Et.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Et.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},ce={init:function(){var t=[[Et.Msg.MIXLY_MAX,"max"],[Et.Msg.MIXLY_MIN,"min"]];this.setColour(le),this.appendValueInput("A").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Et.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Et.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Et.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},ge={init:function(){var t=[[Et.Msg.MATH_TWO,"two"],[Et.Msg.MATH_EIGHT,"eight"],[Et.Msg.MATH_TEN,"ten"],[Et.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(le),this.appendDummyInput("").appendField(Et.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Et.FieldDropdown(t),"OP").appendField(Et.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MATH_ZHW).appendField(new Et.FieldDropdown(t),"OP2").appendField(Et.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Et.Msg.MATH_Before_two,eight:Et.Msg.MATH_Before_eight,ten:Et.Msg.MATH_Before_ten,sixteen:Et.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Et.Msg.MATH_Behind_two,eight:Et.Msg.MATH_Behind_eight,ten:Et.Msg.MATH_Behind_ten,sixteen:Et.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ce={init:function(){var t=[[Et.Msg.LANG_MATH_INT,"int"],[Et.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(le),this.setOutput(!0,Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Et.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Et.Msg.LANG_MATH_INT,float:Et.Msg.LANG_MATH_FLOAT_RANDOM};return Et.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Se={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Et.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ae={init:function(){this.setColour(le),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Et.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Et.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Le={init:function(){this.setColour(le),this.appendDummyInput().appendField(new Et.FieldTextInput("0",Et.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Et.Msg.MATH_NUMBER_TOOLTIP)}},Ne={init:function(){this.setColour(le),this.appendValueInput("NUM").setCheck(Number).appendField(Et.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},De={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MATH_ROUND).appendField(Et.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Et.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Et.Msg.MATH_ROUND_NEW_TOOLTIP)}},fe={init:function(){var t=[[Et.Msg.MIXLY_TO_INT,"int"],[Et.Msg.MIXLY_TO_FLOAT,"float"],[Et.Msg.MIXLY_TO_BITES,"b"],[Et.Msg.LANG_MATH_BYTE+Et.Msg.MIXLY_TO_INT,"bti"]];this.setColour(le),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Et.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Et.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Et.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Fe={init:function(){var t=[[Et.Msg.MIXLY_TO_INT,"int"],[Et.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(le),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Et.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Et.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Pe=Ae,ve={init:function(){this.setColour(le),this.appendValueInput("VAR").appendField(Et.Msg.LANG_MATH_BYTE+Et.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ye={init:function(){this.setColour(le),this.itemCount_=1,this.setMutator(new Et.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Et.Msg.MIXLY_PRODUCT+Et.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Et.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Et.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Et.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ve={init:function(){this.setColour(Xe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Et.FieldTextInput("",Et.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Et.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Et.FieldImage(e,7,12,'"')}},be={init:function(){this.setColour(Xe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Et.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Be={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ge={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(String).appendField(Et.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Ue={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},we={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ke={init:function(){this.WHERE_OPTIONS=[[Et.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Et.Msg.TEXT_GET_INDEX_RANDOM+1+Et.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.LISTS_GET_INDEX_GET,"MODE"),Et.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Et.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+Et.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Et.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:Et.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Et.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Et.Msg.TEXT_GET_INDEX_RANDOM};return Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+Et.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Et.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Et.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Et.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Et.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Et.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},He={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Et.Msg.LISTS_GET_INDEX_GET+" "+Et.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Et.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+Et.Msg.LISTS_GET_INDEX_FROM_START+"n"+Et.Msg.TEXT_CHARAT2)}},We={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Et.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Et.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ke={init:function(){this.WHERE_OPTIONS_1=[[Et.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Et.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Et.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Et.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Et.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Et.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==Et.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Et.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Et.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new Et.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Je={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Et.Msg.LISTS_GET_INDEX_GET+" "+Et.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Et.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Et.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Et.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},qe={init:function(){var t=[[Et.Msg.MIXLY_EQUALS,"==="],[Et.Msg.MIXLY_STARTSWITH,"startswith"],[Et.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Xe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Et.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ze={init:function(){this.setColour(Xe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Et.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_COMPARETO_HELP)}},Qe={init:function(){var t=[[Et.Msg.TEXT_UPPER,"upper"],[Et.Msg.TEXT_TITLE,"title"],[Et.Msg.TEXT_CAPITALIZE,"capitalize"],[Et.Msg.TEXT_SWAPCASE,"swapcase"],[Et.Msg.TEXT_LOWER,"lower"]];this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Et.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Et.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Et.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Et.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Et.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},je={init:function(){var t=[[Et.Msg.TEXT_LJUST,"ljust"],[Et.Msg.TEXT_CENTER,"center"],[Et.Msg.TEXT_RJUST,"rjust"]];this.setColour(Xe),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Et.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Et.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ze={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Et.Msg.MIXLY_MID+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Et.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},$e={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ti={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Et.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Et.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},ei={init:function(){this.setColour(Xe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Et.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Et.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ii={init:function(){var t=[[Et.Msg.TEXT_TRIM_BOTH,"strip"],[Et.Msg.TEXT_TRIM_LEFT,"lstrip"],[Et.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Xe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Et.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Et.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Et.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Et.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Et.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ni={init:function(){this.setColour(Xe),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Et.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Et.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Zi={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},$i={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_KEYS),this.setTooltip(Et.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Et.Msg.DICTS_GET_TOOLTIP)}},nn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Et.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Et.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},sn={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Et.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},_n={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_DELETE_TOOLTIP)}},on={init:function(){this.setColour(Qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(Et.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Et.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MID),this.setTooltip(Et.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_CLEAR),this.setTooltip(Et.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_ITEMS),this.setTooltip(Et.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},un={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_VALUES),this.setTooltip(Et.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},rn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_LENGTH),this.setTooltip(Et.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},ln={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_DELDICT),this.setTooltip(Et.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dn={init:function(){this.MODE=[[Et.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Et.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Et.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Et.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Et.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Et.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Et.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},In={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.setTooltip(Et.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Et.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Mn={init:function(){this.setColour(Qi),this.appendDummyInput("").appendField(new Et.FieldLabel(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Et.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},hn={init:function(){this.setColour(Qi),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TO_JSON),this.setTooltip(Et.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},On={init:function(){this.setColour(Qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Et.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Rn=210,cn={init:function(){var t=Et.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Et.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Et.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Et.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Et.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Et.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Et.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},gn={init:function(){var t=Et.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Et.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Et.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Cn={init:function(){var t=[[Et.Msg.LOGIC_OPERATION_AND,"AND"],[Et.Msg.LOGIC_OPERATION_OR,"OR"],[Et.Msg.LOGIC_OPERATION_NOR,"NOR"],[Et.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Et.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Et.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Et.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Et.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Et.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Sn={init:function(){this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Et.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Et.Msg.LOGIC_NEGATE_TOOLTIP)}},An={init:function(){var t=[[Et.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Et.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Et.FieldDropdown(t),"BOOL"),this.setTooltip(Et.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ln={init:function(){this.setColour(Rn),this.setOutput(!0),this.appendDummyInput().appendField(Et.Msg.LOGIC_NULL),this.setTooltip(Et.Msg.LOGIC_NULL_TOOLTIP)}},Nn={init:function(){this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Et.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Et.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Dn={init:function(){var t=[[Et.Msg.TEXT_APPEND_TO,"in"],[Et.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Et.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Et.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.IN)}},fn={init:function(){var t=[[Et.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Et.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Fn={init:function(){this.setColour(Rn),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Pn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Et.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG,o=Et.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Et.Msg.MIXPY_TEXT_ENCODE).appendField(new Et.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG,o=Et.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},xn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Et.Msg.MICROBIT_PYTHON_TYPE)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.HTML_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const kn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Jn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},qn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Et.Msg.MIXLY_ESP32_SET+{mkdir:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Et.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.HTML_FILE,"isfile"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Et.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$n={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Et.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},ts={};ts.NAME_TYPE=Et.PROCEDURE_CATEGORY_NAME,ts.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(Et.Msg.MIXLY_AIP_ATTR).setAlign(Et.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Qs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_FORM_CONTENT).appendField(new Et.FieldDropdown([[Et.Msg.HTML_TEXT,"text"],[Et.Msg.HTML_EMAIL,"email"],[Et.Msg.HTML_NUMBER,"number"],[Et.Msg.HTML_PASSWORD,"password"],[Et.Msg.HTML_CHECKBOX,"checkbox"],[Et.Msg.HTML_RADIOBUTTON,"radiobutton"],[Et.Msg.HTML_BUTTON,"button"],[Et.Msg.HTML_COLOUR,"colour"],[Et.Msg.HTML_DATE,"date"],[Et.Msg.HTML_LOCALTIME,"local time"],[Et.Msg.HTML_FILE,"file"],[Et.Msg.HTML_HIDDEN,"hidden"],[Et.Msg.HTML_IMAGE,"image"],[Et.Msg.HTML_MONTH,"month"],[Et.Msg.HTML_RANGE,"range"],[Et.Msg.HTML_RESET,"reset"],[Et.Msg.HTML_SEARCH,"search"],[Et.Msg.HTML_SUBMIT,"submit"],[Et.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Et.Msg.HTML_TIME,"time"],[Et.Msg.HTML_URL,"url"],[Et.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Et.Msg.HTML_NAME).appendField(new Et.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Et.Msg.HTML_VALUE).appendField(new Et.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Et.Msg.MIXLY_AIP_ATTR).setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(ks),this.appendDummyInput().appendField(new Et.FieldTextInput("property"),"KEY").appendField(":").appendField(new Et.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(new Et.FieldTextInput("property"),"KEY").appendField(":").appendField(new Et.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_TEXT).appendField(new Et.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},t_=160,e_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Et.FieldTable(""),"TEXT")}},i_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Et.FieldMultilineInput(""),"TEXT")}},n_={init:function(){this.setColour(t_),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Et.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},s_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},__={init:function(){this.setColour(t_),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Et.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},o_={init:function(){this.setColour(t_),this.appendValueInput("VALUE").appendField(Et.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},p_={init:function(){this.setColour(t_),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Et.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Et.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Et.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},Et.isNumber(n)&&Et.isNumber(s)&&Et.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const jp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},Zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},$p=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ta=function(t,e){return["None",e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ia=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},na=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sa=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},_a=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},oa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},pa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},aa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ua=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ra=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},la=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Ta=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ha=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ea=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ra=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ca=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},La=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Na=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Da=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),Et.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},ru=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},lu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},du=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Iu=function(t,e){return'"},Tu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Mu=function(){return this.getFieldValue("TEXT")+"\n"},hu=function(t){return t.getFieldValue("TEXT")+"\n"},mu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ou=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Eu=function(){return""},Ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},cu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},Cu.scrubNakedValue=function(t){return t+"\n"},Cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=Et.utils.string.wrap(_,Cu.COMMENT_WRAP-3),n+=Cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Su="#74A55B",Au={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_RGB_PIN_COUNT)}},Lu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Nu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Du={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},fu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Et.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Et.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Fu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Pu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_RESET)}},vu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Xu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},xu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},yu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Vu={init:function(){this.setColour(Su),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},bu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(Su),this.appendValueInput("VAR").appendField("360°"+Et.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SETTING+Et.Msg.blockpy_turtle_rotate+Et.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Gu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("180°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_MOVE)}},Uu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("360°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},wu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("180°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},ku={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("360°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Hu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new Et.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(Et.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},Wu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Et.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[Et.Msg.MOTOR_N,"ms32006.MOT_N"],[Et.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Ku={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new Et.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Et.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Ju={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_RGB_PIN_COUNT)}},qu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},zu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Qu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_WRI)}},ju={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new Et.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+Et.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Zu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},$u={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},tr={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(Et.Msg.MIXLY_PROGRAM_BLOCK).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},er={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(Et.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(Et.Msg.MIXLY_PROGRAM_BLOCK).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},ir={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},nr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},sr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_TRAFFIC_LIGHT).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LISTS_SET_INDEX_SET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_WHITE,"W"],[Et.Msg.COLOUR_RGB_RED,"R"],[Et.Msg.COLOUR_RGB_YELLOW,"Y"],[Et.Msg.COLOUR_RGB_GREEN,"G"],[Et.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_WHITE,"W"],[Et.Msg.COLOUR_RGB_RED,"R"],[Et.Msg.COLOUR_RGB_YELLOW,"Y"],[Et.Msg.COLOUR_RGB_GREEN,"G"],[Et.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},ar={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[Et.Msg.MIXLY_SPEED,"[1]"],[Et.Msg.MATH_SINGLE_OP_ABSOLUTE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[Et.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[Et.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[Et.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ur={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},rr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MATH_SINGLE_OP_ABSOLUTE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"0"],[Et.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[Et.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField("("+Et.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},Tr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField("("+Et.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"0"],[Et.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Mr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MOTOR,"ext_motor"],[Et.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[Et.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[Et.Msg.COLOUR_RGB_RED+"LED","R_LED"],[Et.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[Et.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[Et.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[Et.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},hr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MOTOR,"ext_motor"],[Et.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[Et.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[Et.Msg.COLOUR_RGB_RED+"LED","R_LED"],[Et.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[Et.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[Et.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[Et.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},mr="#6C9858",Or={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},Er={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_ON,"1"],[Et.Msg.MIXLY_ESP32_OFF,"0"],[Et.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Rr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},cr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},gr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Cr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Sr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(Et.Msg.MIXLY_LCD_SETCOLOR).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LIGHT_RED,"1"],[Et.Msg.MIXLY_LIGHT_GREEN,"2"],[Et.Msg.MIXLY_LIGHT_BLUE,"3"],[Et.Msg.MIXLY_LIGHT_YELLOW,"4"],[Et.Msg.MIXLY_LIGHT_CYAN,"5"],[Et.Msg.MIXLY_LIGHT_PURPLE,"6"],[Et.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Ar={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},Lr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Nr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Dr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},fr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Fr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Pr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},vr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Yr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.PYTHON_RANGE_STEP).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Xr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_WRI)}},xr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},yr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Vr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.PYTHON_RANGE_STEP).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},br={init:function(){this.setColour(mr),this.appendValueInput("TICKS").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Et.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Et.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Br={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Gr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_RESET)}},Ur={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},wr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},kr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hr={init:function(){this.setColour(mr),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Wr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(mr),this.appendDummyInput().appendField("MixGo Car").appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField("MixGo Car").appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},qr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_STOP).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},jr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[Et.Msg.MIXLY_SPEED,"SPEED"],[Et.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.MIXLY_MOTOR).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"1"],[Et.Msg.TEXT_TRIM_RIGHT,"2"],[Et.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[Et.Msg.MIXLY_SPEED,"SPEED"],[Et.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},tl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[Et.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(Et.Msg.MIXLY_MOTOR).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"0"],[Et.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sl={init:function(){this.setColour(mr),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(mr),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_MIXBOT_BUZZER+Et.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},pl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_MIXBOT_BUZZER+Et.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},al={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_RECORD_AUDIO).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(Et.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_PLAY_AUDIO).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},rl={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ll={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},dl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Il={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.LISTS_SET_INDEX_SET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Tl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT+Et.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ml={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.LISTS_SET_INDEX_SET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.MIXLY_ALL+Et.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(Et.ALIGN_RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT+Et.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},hl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.ANALOG+Et.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(Et.Msg.MIXLY_RELEASE).appendField(new Et.FieldDropdown([[Et.Msg.MICROPYTHON_DISPLAY_YES,"True"],[Et.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.ANALOG+Et.Msg.MIXLY_KEYBOARD_INPUT)}},ml={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SPECIAL_KEY).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[Et.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[Et.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[Et.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[Et.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[Et.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[Et.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[Et.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[Et.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Ol={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GENERAL_KEY).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},El={init:function(){this.setColour(mr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new Et.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(Et.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},$m={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Et.Msg.MIXLY_WIFI_USERNAME).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Et.Msg.MIXLY_IOT_PASSWORD).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Et.Msg.MIXLY_EMQX_PROJECT).setAlign(Et.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Et.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Et.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},eO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Et.Msg.MIXLY_EMQX_SUBSCRIBE+Et.Msg.MIXLY_MICROBIT_MSG).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Et.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_O={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Et.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},oO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},pO={init:function(){this.setColour(km),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},aO={init:function(){this.setColour(km),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},uO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},rO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO").appendField(Et.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Et.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},lO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+Et.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IO={init:function(){this.VISITOR_ID=Rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(km),this.appendDummyInput("").appendField(new Et.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},TO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO").appendField(Et.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},MO={init:function(){this.setColour(km),this.appendDummyInput().appendField("HTTP"+Et.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Et.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Et.Msg.MIXLY_REQUESTS_GET).appendField(Et.Msg.MIXLY_GET_CURRENT_TIME).appendField(Et.Msg.MIXLY_OPEN_DEBUG).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hO={init:function(){this.setColour(km),this.appendDummyInput().appendField("HTTP"+Et.Msg.MIXLY_Client).appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Et.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Et.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MQTT"+Et.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Et.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Et.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Et.Msg.MQTT_Topic).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Et.Msg.MIXLY_OPEN_DEBUG).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},OO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MQTT"+Et.Msg.MIXLY_Client).appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Et.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Et.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},EO=Hm,RO=Wm,cO=Km,gO=Jm,CO=zm,SO=225,AO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(Et.Msg.MIXLY_NETWORK_MODE).appendField(new Et.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},LO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[Et.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=Et.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:Et.Msg.MIXLY_NETWORK_WIFI_OPEN,False:Et.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},NO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},DO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:Et.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},fO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(Et.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(Et.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},FO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_CONNECT+Et.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},PO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[Et.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[Et.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:Et.Msg.MIXLY_ESP32_NETWORK_IP,1:Et.Msg.MIXLY_ESP32_NETWORK_MASK,2:Et.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},vO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},YO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[Et.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},XO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(Et.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(Et.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},xO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},yO={init:function(){this.setColour(SO),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new Et.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},VO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},bO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},BO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},GO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},UO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},wO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},kO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},HO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},WO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},KO={init:function(){this.setColour(SO),this.appendValueInput("DOMAIN").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_REQUESTS_GET).appendField(new Et.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},JO={init:function(){this.appendValueInput("VAL");var t=[[Et.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:Et.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Et.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Et.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},qO={init:function(){this.appendValueInput("VAR").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(Et.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:Et.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Et.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},zO={init:function(){this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(Et.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QO={init:function(){this.setColour(SO),this.appendDummyInput("").appendField(new Et.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},jO="#3288dd",ZO={init:function(){this.setColour(jO),this.appendValueInput("URL").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(Et.Msg.blockpy_REQUESTS).appendField(Et.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},$O={init:function(){this.setColour(jO),this.appendValueInput("URL").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(Et.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(Et.Msg.blockpy_REQUESTS+Et.Msg.OLED_STRING),this.appendDummyInput("").appendField(Et.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},tE={init:function(){this.appendValueInput("VAL");var t=[[Et.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Et.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(jO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},eE="#A58C5B",iE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SENOR_IS_PRESSED)}},nE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SENOR_WAS_PRESSED)}},sE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_BUTTON+Et.Msg.MIXLY_GET_PRESSES)}},_E={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[Et.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[Et.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},oE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_shake,"shake"],[Et.Msg.MIXLY_UP,"up"],[Et.Msg.MIXLY_DOWN,"down"],[Et.Msg.MIXLY_LEFT,"left"],[Et.Msg.MIXLY_RIGHT,"right"],[Et.Msg.MIXLY_MICROBIT_face_up,"face up"],[Et.Msg.MIXLY_MICROBIT_face_down,"face down"],[Et.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=Et.Msg.MIXLY_MICROBIT_JS_CURRENT,n=Et.Msg.MSG.catSensor,s=Et.Msg.MIXLY_MICROBIT_JS_STATE,_=Et.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:Et.Msg.MIXLY_MICROBIT_shake,up:Et.Msg.MIXLY_UP,down:Et.Msg.MIXLY_DOWN,left:Et.Msg.MIXLY_LEFT,right:Et.Msg.MIXLY_RIGHT,"face up":Et.Msg.MIXLY_MICROBIT_face_up,"face down":Et.Msg.MIXLY_MICROBIT_face_down,freefall:Et.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},pE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},aE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},uE={init:function(){var t=[[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(eE),this.appendValueInput("PIN",Number).appendField(new Et.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new Et.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},rE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},lE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},dE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"left"],[Et.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(Et.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=Et.Msg.MIXLY_ESP32_NEAR;return i+{left:Et.Msg.TEXT_TRIM_LEFT,right:Et.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},IE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[Et.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":Et.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":Et.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},TE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[Et.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},ME={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},hE={init:function(){this.setColour(eE),this.appendDummyInput("").appendField("LM35"+Et.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_LM35)}},mE={init:function(){this.setColour(eE),this.appendValueInput("I2CSUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Et.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},OE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[Et.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[Et.Msg.MIXLY_ESP32_MAX30102_IR+","+Et.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[Et.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[Et.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},RE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},cE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.HTML_COLOUR+Et.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET+Et.Msg.HTML_COLOUR,"[2]"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_IR_STRENGTH,"[1]"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},gE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.HTML_COLOUR+Et.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET+"RGB"+Et.Msg.HTML_COLOUR,"0"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_RGB_RAW,"1"],[Et.Msg.MIXLY_GET_ENV_LIGHT+Et.Msg.MIXLY_BRIGHTNESS,"2"],[Et.Msg.GET_IR_STRENGTH+Et.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},CE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET_ENV_LIGHT,"E"],[Et.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},SE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},AE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},LE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},NE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},fE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MIXGOPE_FIELD+Et.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[Et.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},FE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_shake,"shake"],[Et.Msg.MIXLY_UP,"up"],[Et.Msg.MIXLY_DOWN,"down"],[Et.Msg.MIXLY_LEFT,"left"],[Et.Msg.MIXLY_RIGHT,"right"],[Et.Msg.MIXLY_MICROBIT_face_up,"face up"],[Et.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=Et.Msg.MIXLY_MICROBIT_JS_CURRENT,n=Et.Msg.MSG.catSensor,s=Et.Msg.MIXLY_MICROBIT_JS_STATE,_=Et.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:Et.Msg.MIXLY_MICROBIT_shake,up:Et.Msg.MIXLY_UP,down:Et.Msg.MIXLY_DOWN,left:Et.Msg.MIXLY_LEFT,right:Et.Msg.MIXLY_RIGHT,"face up":Et.Msg.MIXLY_MICROBIT_face_up,"face down":Et.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},PE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},vE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_GET+Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},YE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Et.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},XE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},xE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_GETTEMPERATUE)}},yE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return Et.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},VE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},bE={init:function(){this.setColour(eE),this.appendValueInput("SPISUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Et.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},BE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[Et.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},GE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},UE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},wE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(Et.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},HE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_SCAN_OK,"0"],[Et.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[Et.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},WE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},KE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},JE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Et.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},eD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},nD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},_D=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},oD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},pD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},aD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},uD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},rD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},lD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},dD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},TD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},MD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},hD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},mD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},OD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},ED=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},RD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},cD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},gD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},CD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},SD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},AD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},LD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},ND=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},DD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},fD=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},FD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},PD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},vD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},YD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},XD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},xD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},yD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},VD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},bD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},BD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},GD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},UD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},wD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},kD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},HD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},WD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},KD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},JD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Rt.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},qD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},zD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},QD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},ZD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},tf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},nf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},sf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},_f=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},of=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},pf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},af=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},uf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},rf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},lf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},df=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},If=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},Tf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},Mf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},hf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},mf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Of=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Qf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},jf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Zf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},$f=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},tF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},eF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},iF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},nF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},sF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},_F=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},oF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},pF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},aF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},uF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},rF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},lF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},dF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},IF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},TF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},MF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},hF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},mF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},OF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},EF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},RF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Mx=function(){return"control.reset()\n"},hx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+")\n"},mx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+")\n"},Ox=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Ex=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Rx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},cx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},gx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Cx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Sx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Ax=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Lx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Nx=function(){return"while True:\n pass\n"},Dx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},fx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Fx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Px=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},vx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Yx=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Xx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},xx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},yx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},Vx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},bx=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},Bx=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Gx=xx,Ux=Yx,wx=Xx,kx=Fx,Hx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Kx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Jx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},$x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ty=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ny=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},sy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},_y={};_y["MixGo MINI"]={description:"MicroPython[ESP32C3 MixGo MINI]",digital_pin:Rt.Profile.generate(["0-10","18"]),input_pin:Rt.Profile.generate(["0-10","18"]),output_pin:Rt.Profile.generate(["0-10","18"]),pwm_input:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_input:Rt.Profile.generate(["0-4"],"adc","adc"),pwm_output:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_output:Rt.Profile.generate(["0-4"],"adc","adc"),espnow_channel:Rt.Profile.generate(["1-13"]),haskylens_model:Rt.Profile.generate(["0-4"]),digital:Rt.Profile.generate(["0-10","18"],"pin","pin"),pwm_pin:Rt.Profile.generate(["0-10","18"]),pwm:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_pin:Rt.Profile.generate(["0-4"]),analog:Rt.Profile.generate(["0-4"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Rt.Profile.generate(["0-4"]),exlcdh:Rt.Profile.generate(["0-11"]),exlcdv:Rt.Profile.generate(["0-7"]),brightness:Rt.Profile.generate(["0-9"]),tts_voice:Rt.Profile.generate(["0-16"]),tts_builtin_music:Rt.Profile.generate(["0-47"]),tts_bgmusic:Rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["ANGRY","onboard_matrix.ANGRY"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["DOOR_OPEN","onboard_matrix.DOOR_OPEN"],["DOOR_OPENING","onboard_matrix.DOOR_OPENING"],["DOOR_CLOSE","onboard_matrix.DOOR_CLOSE"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["BIRTHDAY","onboard_music.BIRTHDAY"],["BA_DING","onboard_music.BA_DING"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},_y["ESP32C2 Generic(2M)"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Rt.Profile.generate(["0-11","18-21"]),input_pin:Rt.Profile.generate(["0-11","18-21"]),output_pin:Rt.Profile.generate(["0-11","18-21"]),pwm_input:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Rt.Profile.generate(["0-5"],"adc","adc"),pwm_output:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Rt.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Rt.Profile.generate(["1-13"]),haskylens_model:Rt.Profile.generate(["0-4"]),digital:Rt.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Rt.Profile.generate(["0-11","18-21"]),pwm:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Rt.Profile.generate(["0-5"]),analog:Rt.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Rt.Profile.generate(["0-4"]),exlcdh:Rt.Profile.generate(["0-31"]),exlcdv:Rt.Profile.generate(["0-11"]),brightness:Rt.Profile.generate(["0-9"]),tts_voice:Rt.Profile.generate(["0-16"]),tts_builtin_music:Rt.Profile.generate(["0-47"]),tts_bgmusic:Rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const oy=_y,py=20,ay={init:function(){this.setColour(py),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_HIGH,"HIGH"],[Et.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},uy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},ry={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},ly={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField("DAC"+Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},dy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_mSecond,"period"],[Et.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Iy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_REF_VOLTAGE+Et.Msg.MIXLY_STAT).appendField(new Et.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},Ty={init:function(){this.setColour(py),this.appendValueInput("pin").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},My={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[Et.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[Et.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},hy={init:function(){this.setColour(20),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_AS).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[Et.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[Et.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[Et.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},my={init:function(){this.setColour(py),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("dac#"),"PIN_OBJ").appendField(Et.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+Et.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Oy={init:function(){this.setColour(py),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("tc#"),"PIN_OBJ").appendField(Et.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Ey={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField("PWM"+Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_FREQUENCY+Et.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},Ry=hy,cy=Oy,gy=Ty,Cy=My,Sy=40,Ay={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput("").appendField(t).appendField(Et.Msg.MIXLY_TEM_HUM+" AHT21").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[t]}))}},Ly={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput("").appendField(t).appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" HP203X").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ny={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},Dy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},fy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,Number),this.setInputsInline(!0)}},Fy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Py={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(Et.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0)}},vy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_SCAN_OK,"True"],[Et.Msg.MIXLY_RFID_SCAN_NOTAGERR,"None"],[Et.Msg.MIXLY_RFID_SCAN_ERROR,"False"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Yy=100,Xy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXGO_LEFT_FRONT+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[0]"],[Et.Msg.MIXGO_RIGHT_FRONT+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[1]"],[Et.Msg.MIXGO_LEFT_BACK+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[3]"],[Et.Msg.MIXGO_RIGHT_BACK+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[2]"],[Et.Msg.MIXGO_LEFT_FRONT+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[0]"],[Et.Msg.MIXGO_RIGHT_FRONT+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[1]"],[Et.Msg.MIXGO_LEFT_BACK+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[3]"],[Et.Msg.MIXGO_RIGHT_BACK+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[2]"],[Et.Msg.ME_GO_LIGHT_HEADLIGHT,"WLED"]]),"op"),this.setOutput(!0)}},xy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField("ME GO"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},yy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField("ME GO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Vy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField("ME GO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},by={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField("ME GO"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},By={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Gy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Uy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"0"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"1"],[Et.Msg.ME_GO_MOTOR_EXTERN,"2"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.ROTATION_FORWARD,"CW"],[Et.Msg.ROTATION_BACKWARD,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_INTERRUPT).appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ky={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP),this.appendDummyInput("").appendField(new Et.FieldDropdown([["turns","turns"],["distance","distance"],["turns,distance","all"]]),"args"),this.appendValueInput("num").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Hy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("").appendField(new Et.FieldDropdown([["turns","turns"],["distance","distance"],["speed","speed"]]),"args"),this.setOutput(!0),this.setInputsInline(!0)}},Wy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"[0]"],[Et.Msg.MIXGO_LEFT_MID,"[1]"],[Et.Msg.MIXGO_RIGHT_MID,"[2]"],[Et.Msg.TEXT_TRIM_RIGHT,"[3]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXGO_LINE_SENSOR_VAL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ESP32_NEAR}))}},Ky={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXGO_LEFT_FRONT,"[0]"],[Et.Msg.MIXGO_RIGHT_FRONT,"[1]"],[Et.Msg.MIXGO_LEFT_BACK,"[3]"],[Et.Msg.MIXGO_RIGHT_BACK,"[2]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXGO_PROXIMITY_SENSOR),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ESP32_NEAR}))}},Jy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXGO_CAR_SENSOR_ONBOARD_CHANGE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ME_GO_CAR_SENSOR_ONBOARD_AUTO_CHANGE,"AS"],[Et.Msg.MIXLY_MIXGO_CAR_USE_LINE_ONLY,"LP"],[Et.Msg.MIXLY_MIXGO_CAR_USE_PROXIMITY_ONLY,"OA"],[Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_ONLY,"LS"],[Et.Msg.ME_GO_SENSOR_MODE_OFF,"CL"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GET_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.ME_GO_PITCH,"[0]"],[Et.Msg.ME_GO_ROLL,"[1]"],[Et.Msg.ME_GO_PITCH+", "+Et.Msg.ME_GO_ROLL,""]]),"angle"),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},zy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"[0]"],[Et.Msg.MIXGO_LEFT_MID,"[1]"],[Et.Msg.MIXGO_RIGHT_MID,"[2]"],[Et.Msg.TEXT_TRIM_RIGHT,"[3]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR}))}},Qy=230,jy={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital),"PIN"),this.setOutput(!0)}},Zy={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},tV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},eV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},iV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},nV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},sV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},_V={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},oV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},pV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},aV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},uV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},rV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},lV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},dV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},IV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog),"PIN"),this.setOutput(!0)}},TV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},MV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.dac),"PIN"),this.setOutput(!0)}},hV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},mV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},OV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},EV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},RV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},cV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},gV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.touch),"PIN"),this.setOutput(!0)}},CV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},SV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},AV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},LV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},NV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},DV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},fV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},FV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},PV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},vV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},YV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},XV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},xV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},yV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},VV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},bV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},BV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},GV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},UV=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},wV=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},kV=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},HV=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},WV=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},KV=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},JV=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},qV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},zV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},QV=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},jV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},ZV=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mini_g2="import mini_g2",["mini_g2.ext_ahtx0."+i+"()",e.ORDER_ATOMIC]},$V=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mini_g2="import mini_g2",["mini_g2.ext_hp203x."+i,e.ORDER_ATOMIC]},tb=function(t,e){e.definitions_.import_mini_g2="import mini_g2";return["mini_g2.varistor()",e.ORDER_ATOMIC]},eb=function(t,e){if(e.definitions_.import_mini_g2="import mini_g2","mixgo_mini"==Rt.Boards.getSelectedBoardKey().split(":")[2]){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var i='ext_rfid.read_card(0, x="id")'}else{e.definitions_.import_mini_g2="import mini_g2";i='mini_g2.ext_rc522.read_card(0, x="id")'}return[i,e.ORDER_ATOMIC]},ib=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var s="ext_rfid.read_card("+n+")"}else{e.definitions_.import_mini_g2="import mini_g2";s="mini_g2.ext_rc522.read_card("+n+")"}return[s,e.ORDER_ATOMIC]},nb=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var _="ext_rfid.write_card("+s+","+n+")\n"}else{e.definitions_.import_mini_g2="import mini_g2";_="mini_g2.ext_rc522.write_card("+s+","+n+")\n"}return _},sb=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var _="ext_rfid.write_card("+s+","+n+")"}else{e.definitions_.import_mini_g2="import mini_g2";_="mini_g2.ext_rc522.write_card("+s+","+n+")"}return[_,e.ORDER_ATOMIC]},_b=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var s="ext_rfid.scan_card()=="+n}else{e.definitions_.import_mini_g2="import mini_g2";s="mini_g2.ext_rc522.scan_card()=="+n}return[s,e.ORDER_ATOMIC]},ob=function(t,e){return e.definitions_.import_me_go_car="from me_go import car",["car."+this.getFieldValue("op"),e.ORDER_ATOMIC]},pb=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car","car.setonoff("+i+","+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},ab=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car",["car.getrightness("+i+")",e.ORDER_ATOMIC]},ub=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car",["car.getonoff("+i+")",e.ORDER_ATOMIC]},rb=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car","car.setbrightness("+i+","+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},lb=function(t,e){var i=this.getFieldValue("VAR");return e.definitions_.import_me_go_car="from me_go import car",'car.move("'+i+'",'+e.valueToCode(this,"speed",e.ORDER_ASSIGNMENT)+")\n"},db=function(t,e){var i=this.getFieldValue("VAR");return e.definitions_.import_me_go_car="from me_go import car",'car.move("'+i+'")\n'},Ib=function(t,e){var i=this.getFieldValue("wheel");e.definitions_.import_me_go_car="from me_go import car";var n=this.getFieldValue("direction");return 0==i&&("CW"==n?n="CCW":"CCW"==n&&(n="CW")),"car.motor(car.MOTO["+i+'],"'+n+'",'+e.valueToCode(this,"speed",e.ORDER_ATOMIC)+")\n"},Tb=function(t,e){var i=this.getFieldValue("mode");return e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i,"hall_"+i+".irq_cb("+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+")\n"},Mb=function(t,e){var i=this.getFieldValue("mode"),n=this.getFieldValue("args");e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i;var s=e.valueToCode(this,"num",e.ORDER_ATOMIC);return"all"==n?"hall_"+i+".initial(turns="+s+",distance="+s+")\n":"hall_"+i+".initial("+n+"="+s+")\n"},hb=function(t,e){var i=this.getFieldValue("mode"),n=this.getFieldValue("args");return e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i,["hall_"+i+"."+n,e.ORDER_ATOMIC]},mb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.patrol()"+i,e.ORDER_ATOMIC]},Ob=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.obstacle()"+i,e.ORDER_ATOMIC]},Eb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car","car.ir_mode(car."+i+")\n"},Rb=function(t,e){return e.definitions_.import_mixgo_me_onboard_mxc6655xa="from mixgo_me import onboard_mxc6655xa",["onboard_mxc6655xa.eulerangles(upright=True)"+this.getFieldValue("angle"),e.ORDER_ATOMIC]},cb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.light()"+i,e.ORDER_ATOMIC]},gb=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Cb=gb,Sb=gb,Ab=gb,Lb=gb,Nb=gb,Db=gb,fb=gb,Fb=gb,Pb=gb,vb=gb,Yb=gb,Xb=gb,xb=gb,yb=gb,Vb=gb,bb=gb,Bb=gb,Gb=gb,Ub=gb,wb=gb,kb=gb,Hb=gb,Wb=gb,Kb=gb,Jb=gb,qb=gb,zb=gb,Qb=gb,jb=gb,Zb=gb,$b=gb,tB=gb,eB=gb,iB=gb,nB=gb,sB=gb,_B=gb,oB=gb,pB=gb,aB=gb,uB=gb,rB=gb,lB=gb,dB=gb;Object.assign(Et.Variables,gt),Object.assign(Et.Procedures,es),Et.Python=Cu,Et.generator=Cu,Rt.Profile.default={},Object.assign(Rt.Profile,oy),Object.assign(Rt.Profile.default,oy["MixGo CC"]),Object.assign(Et.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,b,H,k,X,B,W,f,w,U,G,F,D,N,y,x,V,P,v,Y,lt,dt,It,Tt),Object.assign(Et.Python.forBlock,T,M,h,m,O,E,R,c,g,C,S,A,L,nt,ut,at,$,st,rt,q,pt,ot,_t,z,J,K,et,tt,it,Q,j,Z,Mt,ht,mt,Ot)})(); \ No newline at end of file +class Ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Et.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Et.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Et.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Et.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},wt={init:function(){this.setColour(yt),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.PYTHON_RANGE).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},kt={init:function(){this.setColour(yt),this.appendValueInput("LIST").setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Et.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ht={init:function(){this.setColour(yt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Et.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Et.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Et.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Et.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Wt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Et.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Et.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Kt={init:function(){this.setColour(yt);var t=new Et.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Et.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Et.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Jt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Et.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Et.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},qt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Et.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Et.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Ht.OPERATORS=[[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Kt.OPERATORS=[[Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Et.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},jt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Et.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},$t={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},te={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Et.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},ee={init:function(){this.jsonInit({message0:Et.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:yt,tooltip:Et.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Et.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ie={init:function(){this.setColour(yt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_STAT),this.setOutput(!0)}},ne={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},se={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},_e={init:function(){this.appendDummyInput().appendField(Et.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Et.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Et.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Et.FieldDropdown([[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Et.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(yt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},oe={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pe={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},ae={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ue={init:function(){this.setColour(yt),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_GET_UNIQUE_IDEN)}},re={init:function(){this.setColour(yt),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Et.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},le=230;Et.FieldTextInput.math_number_validator=function(t){return String(t)},Et.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const de={init:function(){this.setColour(le),this.appendDummyInput().appendField(new Et.FieldTextInput("0",Et.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MATH_NUMBER_TOOLTIP)}},Ie={init:function(){this.setColour(le);this.appendDummyInput("").appendField(Et.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Et.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Te={init:function(){this.setColour(le);this.appendDummyInput("").appendField(Et.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Et.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Et.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Me={init:function(){this.setColour(le),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Et.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Et.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Et.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},he={init:function(){this.setColour(le),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Et.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Et.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Et.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Et.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Et.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},me={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Et.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Oe={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Et.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Et.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Et.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Et.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Et.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Et.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Et.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Et.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Ee={init:function(){var t=[[Et.Msg.MATH_BIN,"bin"],[Et.Msg.MATH_OCT,"oct"],[Et.Msg.MATH_HEX,"hex"]];this.setColour(le),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Et.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Et.Msg.MATH_DEC_TOOLTIP_BIN,oct:Et.Msg.MATH_DEC_TOOLTIP_OCT,hex:Et.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Re={init:function(){var t=[[Et.Msg.LANG_MATH_TO_ROUND,"round"],[Et.Msg.LANG_MATH_TO_CEIL,"ceil"],[Et.Msg.LANG_MATH_TO_FLOOR,"floor"],[Et.Msg.MATH_ABS,"fabs"],[Et.Msg.MATH_SQRT,"sqrt"]];this.setColour(le),this.appendValueInput("A").setCheck(Number).appendField(new Et.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Et.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Et.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Et.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Et.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Et.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Et.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},ce={init:function(){var t=[[Et.Msg.MIXLY_MAX,"max"],[Et.Msg.MIXLY_MIN,"min"]];this.setColour(le),this.appendValueInput("A").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Et.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Et.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Et.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},ge={init:function(){var t=[[Et.Msg.MATH_TWO,"two"],[Et.Msg.MATH_EIGHT,"eight"],[Et.Msg.MATH_TEN,"ten"],[Et.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(le),this.appendDummyInput("").appendField(Et.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Et.FieldDropdown(t),"OP").appendField(Et.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MATH_ZHW).appendField(new Et.FieldDropdown(t),"OP2").appendField(Et.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Et.Msg.MATH_Before_two,eight:Et.Msg.MATH_Before_eight,ten:Et.Msg.MATH_Before_ten,sixteen:Et.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Et.Msg.MATH_Behind_two,eight:Et.Msg.MATH_Behind_eight,ten:Et.Msg.MATH_Behind_ten,sixteen:Et.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ce={init:function(){var t=[[Et.Msg.LANG_MATH_INT,"int"],[Et.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(le),this.setOutput(!0,Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Et.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Et.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Et.Msg.LANG_MATH_INT,float:Et.Msg.LANG_MATH_FLOAT_RANDOM};return Et.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Se={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Et.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Et.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ae={init:function(){this.setColour(le),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Et.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Et.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Le={init:function(){this.setColour(le),this.appendDummyInput().appendField(new Et.FieldTextInput("0",Et.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Et.Msg.MATH_NUMBER_TOOLTIP)}},Ne={init:function(){this.setColour(le),this.appendValueInput("NUM").setCheck(Number).appendField(Et.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},De={init:function(){this.setColour(le),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MATH_ROUND).appendField(Et.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Et.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Et.Msg.MATH_ROUND_NEW_TOOLTIP)}},fe={init:function(){var t=[[Et.Msg.MIXLY_TO_INT,"int"],[Et.Msg.MIXLY_TO_FLOAT,"float"],[Et.Msg.MIXLY_TO_BITES,"b"],[Et.Msg.LANG_MATH_BYTE+Et.Msg.MIXLY_TO_INT,"bti"]];this.setColour(le),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Et.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Et.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Et.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Fe={init:function(){var t=[[Et.Msg.MIXLY_TO_INT,"int"],[Et.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(le),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Et.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Et.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Pe=Ae,ve={init:function(){this.setColour(le),this.appendValueInput("VAR").appendField(Et.Msg.LANG_MATH_BYTE+Et.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ye={init:function(){this.setColour(le),this.itemCount_=1,this.setMutator(new Et.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Et.Msg.MIXLY_PRODUCT+Et.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Et.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Et.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Et.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ve={init:function(){this.setColour(Xe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Et.FieldTextInput("",Et.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Et.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Et.FieldImage(e,7,12,'"')}},be={init:function(){this.setColour(Xe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Et.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Be={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ge={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(String).appendField(Et.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Ue={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},we={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ke={init:function(){this.WHERE_OPTIONS=[[Et.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Et.Msg.TEXT_GET_INDEX_RANDOM+1+Et.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.LISTS_GET_INDEX_GET,"MODE"),Et.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Et.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=Et.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+Et.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Et.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:Et.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Et.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Et.Msg.TEXT_GET_INDEX_RANDOM};return Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+Et.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Et.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Et.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Et.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Et.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Et.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},He={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Et.Msg.LISTS_GET_INDEX_GET+" "+Et.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Et.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+Et.Msg.LISTS_GET_INDEX_FROM_START+"n"+Et.Msg.TEXT_CHARAT2)}},We={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Et.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Et.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ke={init:function(){this.WHERE_OPTIONS_1=[[Et.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Et.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Et.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Et.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Et.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Et.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Et.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==Et.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Et.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Et.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new Et.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Je={init:function(){this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Et.Msg.LISTS_GET_INDEX_GET+" "+Et.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Et.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Et.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Et.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},qe={init:function(){var t=[[Et.Msg.MIXLY_EQUALS,"==="],[Et.Msg.MIXLY_STARTSWITH,"startswith"],[Et.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Xe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Et.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ze={init:function(){this.setColour(Xe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Et.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_COMPARETO_HELP)}},Qe={init:function(){var t=[[Et.Msg.TEXT_UPPER,"upper"],[Et.Msg.TEXT_TITLE,"title"],[Et.Msg.TEXT_CAPITALIZE,"capitalize"],[Et.Msg.TEXT_SWAPCASE,"swapcase"],[Et.Msg.TEXT_LOWER,"lower"]];this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Et.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Et.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Et.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Et.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Et.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},je={init:function(){var t=[[Et.Msg.TEXT_LJUST,"ljust"],[Et.Msg.TEXT_CENTER,"center"],[Et.Msg.TEXT_RJUST,"rjust"]];this.setColour(Xe),this.appendValueInput("VAR").appendField(new Et.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Et.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Et.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ze={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Et.Msg.MIXLY_MID+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Et.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},$e={init:function(){this.setColour(Xe),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ti={init:function(){this.setColour(Xe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Et.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Et.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},ei={init:function(){this.setColour(Xe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Et.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Et.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ii={init:function(){var t=[[Et.Msg.TEXT_TRIM_BOTH,"strip"],[Et.Msg.TEXT_TRIM_LEFT,"lstrip"],[Et.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Xe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Et.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Et.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Et.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Et.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Et.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Et.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ni={init:function(){this.setColour(Xe),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Et.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Et.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Zi={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},$i={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_KEYS),this.setTooltip(Et.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Et.Msg.DICTS_GET_TOOLTIP)}},nn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Et.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Et.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},sn={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Et.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},_n={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Et.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_DELETE_TOOLTIP)}},on={init:function(){this.setColour(Qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(Et.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Et.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MID),this.setTooltip(Et.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_CLEAR),this.setTooltip(Et.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_ITEMS),this.setTooltip(Et.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},un={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_VALUES),this.setTooltip(Et.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},rn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_LENGTH),this.setTooltip(Et.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},ln={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.DICT_DELDICT),this.setTooltip(Et.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dn={init:function(){this.MODE=[[Et.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Et.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Et.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Et.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Et.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Et.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Et.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Et.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},In={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Et.Msg.DICTS_ADD_VALUE),this.setTooltip(Et.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Et.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Et.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Mn={init:function(){this.setColour(Qi),this.appendDummyInput("").appendField(new Et.FieldLabel(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Et.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},hn={init:function(){this.setColour(Qi),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TO_JSON),this.setTooltip(Et.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},On={init:function(){this.setColour(Qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Et.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Rn=210,cn={init:function(){var t=Et.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Et.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Et.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Et.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Et.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Et.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Et.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},gn={init:function(){var t=Et.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Et.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Et.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Cn={init:function(){var t=[[Et.Msg.LOGIC_OPERATION_AND,"AND"],[Et.Msg.LOGIC_OPERATION_OR,"OR"],[Et.Msg.LOGIC_OPERATION_NOR,"NOR"],[Et.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Et.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Et.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Et.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Et.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Et.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Sn={init:function(){this.setColour(Rn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Et.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Et.Msg.LOGIC_NEGATE_TOOLTIP)}},An={init:function(){var t=[[Et.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Et.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Rn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Et.FieldDropdown(t),"BOOL"),this.setTooltip(Et.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ln={init:function(){this.setColour(Rn),this.setOutput(!0),this.appendDummyInput().appendField(Et.Msg.LOGIC_NULL),this.setTooltip(Et.Msg.LOGIC_NULL_TOOLTIP)}},Nn={init:function(){this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Et.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Et.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Dn={init:function(){var t=[[Et.Msg.TEXT_APPEND_TO,"in"],[Et.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Et.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Et.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.IN)}},fn={init:function(){var t=[[Et.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Et.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Et.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Fn={init:function(){this.setColour(Rn),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Pn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Et.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG,o=Et.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Et.Msg.MIXPY_TEXT_ENCODE).appendField(new Et.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_USE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=Et.Msg.MIXLY_BELONG,o=Et.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},xn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Et.Msg.MIXLY_MICROBIT_TYPE_STRING+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Et.Msg.MICROBIT_PYTHON_TYPE)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.HTML_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const kn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Jn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},qn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Et.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Et.Msg.MIXLY_ESP32_SET+{mkdir:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Et.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.HTML_FILE,"isfile"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Et.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Et.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$n={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Et.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},ts={};ts.NAME_TYPE=Et.PROCEDURE_CATEGORY_NAME,ts.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(Et.Msg.MIXLY_AIP_ATTR).setAlign(Et.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Qs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_FORM_CONTENT).appendField(new Et.FieldDropdown([[Et.Msg.HTML_TEXT,"text"],[Et.Msg.HTML_EMAIL,"email"],[Et.Msg.HTML_NUMBER,"number"],[Et.Msg.HTML_PASSWORD,"password"],[Et.Msg.HTML_CHECKBOX,"checkbox"],[Et.Msg.HTML_RADIOBUTTON,"radiobutton"],[Et.Msg.HTML_BUTTON,"button"],[Et.Msg.HTML_COLOUR,"colour"],[Et.Msg.HTML_DATE,"date"],[Et.Msg.HTML_LOCALTIME,"local time"],[Et.Msg.HTML_FILE,"file"],[Et.Msg.HTML_HIDDEN,"hidden"],[Et.Msg.HTML_IMAGE,"image"],[Et.Msg.HTML_MONTH,"month"],[Et.Msg.HTML_RANGE,"range"],[Et.Msg.HTML_RESET,"reset"],[Et.Msg.HTML_SEARCH,"search"],[Et.Msg.HTML_SUBMIT,"submit"],[Et.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Et.Msg.HTML_TIME,"time"],[Et.Msg.HTML_URL,"url"],[Et.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Et.Msg.HTML_NAME).appendField(new Et.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Et.Msg.HTML_VALUE).appendField(new Et.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Et.Msg.MIXLY_AIP_ATTR).setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(ks),this.appendDummyInput().appendField(new Et.FieldTextInput("property"),"KEY").appendField(":").appendField(new Et.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs={init:function(){this.setColour(ks),this.appendDummyInput().appendField(new Et.FieldTextInput("property"),"KEY").appendField(":").appendField(new Et.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s={init:function(){this.setColour(ks),this.appendDummyInput().appendField(Et.Msg.HTML_TEXT).appendField(new Et.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},t_=160,e_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Et.FieldTable(""),"TEXT")}},i_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Et.FieldMultilineInput(""),"TEXT")}},n_={init:function(){this.setColour(t_),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Et.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},s_={init:function(){this.setColour(t_),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},__={init:function(){this.setColour(t_),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Et.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},o_={init:function(){this.setColour(t_),this.appendValueInput("VALUE").appendField(Et.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},p_={init:function(){this.setColour(t_),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Et.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Et.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Et.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},Et.isNumber(n)&&Et.isNumber(s)&&Et.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const jp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},Zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},$p=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ta=function(t,e){return["None",e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ia=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},na=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sa=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},_a=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},oa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},pa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},aa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ua=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ra=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},la=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Ta=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ha=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ea=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ra=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ca=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},La=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Na=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Da=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),Et.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},ru=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},lu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},du=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Iu=function(t,e){return'"},Tu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Mu=function(){return this.getFieldValue("TEXT")+"\n"},hu=function(t){return t.getFieldValue("TEXT")+"\n"},mu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ou=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Eu=function(){return""},Ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},cu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},Cu.scrubNakedValue=function(t){return t+"\n"},Cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=Et.utils.string.wrap(_,Cu.COMMENT_WRAP-3),n+=Cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Su="#74A55B",Au={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_RGB_PIN_COUNT)}},Lu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Nu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Du={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},fu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Et.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Et.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Fu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Pu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_RESET)}},vu={init:function(){this.setColour(Su),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Xu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},xu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},yu={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Vu={init:function(){this.setColour(Su),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},bu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(Su),this.appendValueInput("VAR").appendField("360°"+Et.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SETTING+Et.Msg.blockpy_turtle_rotate+Et.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Gu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("180°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_MOVE)}},Uu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("360°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},wu={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("180°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},ku={init:function(){this.setColour(Su),this.appendValueInput("PIN",Number).appendField("360°"+Et.Msg.MIXLY_SERVO).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Hu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new Et.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(Et.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},Wu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Et.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[Et.Msg.MOTOR_N,"ms32006.MOT_N"],[Et.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Ku={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new Et.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Et.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Ju={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_RGB_PIN_COUNT)}},qu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},zu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Qu={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_WRI)}},ju={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new Et.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+Et.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Zu={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},$u={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},tr={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(Et.Msg.MIXLY_PROGRAM_BLOCK).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},er={init:function(){this.setColour(Su),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(Et.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(Et.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(Et.Msg.MIXLY_PROGRAM_BLOCK).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},ir={init:function(){this.setColour(Su),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},nr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},sr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_TRAFFIC_LIGHT).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.LISTS_SET_INDEX_SET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[Et.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_WHITE,"W"],[Et.Msg.COLOUR_RGB_RED,"R"],[Et.Msg.COLOUR_RGB_YELLOW,"Y"],[Et.Msg.COLOUR_RGB_GREEN,"G"],[Et.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_WHITE,"W"],[Et.Msg.COLOUR_RGB_RED,"R"],[Et.Msg.COLOUR_RGB_YELLOW,"Y"],[Et.Msg.COLOUR_RGB_GREEN,"G"],[Et.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},ar={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[Et.Msg.MIXLY_SPEED,"[1]"],[Et.Msg.MATH_SINGLE_OP_ABSOLUTE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[Et.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[Et.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[Et.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ur={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[Et.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},rr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MATH_SINGLE_OP_ABSOLUTE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"0"],[Et.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[Et.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField("("+Et.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},Tr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.ME_GO_MOTOR_EXTERN+Et.Msg.MIXLY_SERVO_MOTOR).appendField(Et.Msg.MIXLY_RELATIVE+Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+Et.Msg.MSG.run).appendField("("+Et.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LEFT,"0"],[Et.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MODE).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPEED+Et.Msg.MIXLY_MODE,"0"],[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER+Et.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(Et.inputs.Align.RIGHT).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"0"],[Et.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Mr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MOTOR,"ext_motor"],[Et.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[Et.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[Et.Msg.COLOUR_RGB_RED+"LED","R_LED"],[Et.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[Et.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[Et.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[Et.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},hr={init:function(){this.setColour(Su),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.ME_GO_MOTOR_EXTERN).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MOTOR,"ext_motor"],[Et.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[Et.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[Et.Msg.COLOUR_RGB_RED+"LED","R_LED"],[Et.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[Et.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[Et.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[Et.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},mr="#6C9858",Or={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},Er={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_ON,"1"],[Et.Msg.MIXLY_ESP32_OFF,"0"],[Et.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Rr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},cr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},gr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Cr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Sr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Et.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(Et.Msg.MIXLY_LCD_SETCOLOR).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_LIGHT_RED,"1"],[Et.Msg.MIXLY_LIGHT_GREEN,"2"],[Et.Msg.MIXLY_LIGHT_BLUE,"3"],[Et.Msg.MIXLY_LIGHT_YELLOW,"4"],[Et.Msg.MIXLY_LIGHT_CYAN,"5"],[Et.Msg.MIXLY_LIGHT_PURPLE,"6"],[Et.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Ar={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},Lr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Nr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Dr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING).appendField(Et.Msg.MIXLY_BUILDIN_LED).appendField(new Et.FieldDropdown([[Et.Msg.COLOUR_RGB_RED,"r"],[Et.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},fr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(new Et.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Fr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Pr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},vr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Yr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.PYTHON_RANGE_STEP).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Xr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_WRI)}},xr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(Et.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},yr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Et.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Vr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(Et.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.PYTHON_RANGE_STEP).appendField(Et.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},br={init:function(){this.setColour(mr),this.appendValueInput("TICKS").setCheck(Number).appendField(Et.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Et.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Et.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Br={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Gr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_RESET)}},Ur={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},wr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Et.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},kr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hr={init:function(){this.setColour(mr),this.appendValueInput("LIST").appendField(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Wr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(mr),this.appendDummyInput().appendField("MixGo Car").appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(mr),this.appendDummyInput("").appendField("MixGo Car").appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},qr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_STOP).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},jr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[Et.Msg.MIXLY_SPEED,"SPEED"],[Et.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXBOT).appendField(Et.Msg.MIXLY_MOTOR).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"1"],[Et.Msg.TEXT_TRIM_RIGHT,"2"],[Et.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[Et.Msg.MIXLY_SPEED,"SPEED"],[Et.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},tl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[Et.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.BITBOT).appendField(Et.Msg.MIXLY_MOTOR).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"0"],[Et.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.CLOCKWISE,"CW"],[Et.Msg.ANTI_CLOCKWISE,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sl={init:function(){this.setColour(mr),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(mr),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_MIXBOT_BUZZER+Et.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},pl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.MIXLY_MIXBOT_BUZZER+Et.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},al={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_RECORD_AUDIO).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(Et.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_PLAY_AUDIO).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},rl={init:function(){this.setColour(mr),this.appendValueInput("PATH").appendField(Et.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ll={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Et.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},dl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Il={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.LISTS_SET_INDEX_SET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Tl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.PIN_NUMBERING).appendField(new Et.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT+Et.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ml={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.LISTS_SET_INDEX_SET+Et.Msg.ME_GO_MOTOR_EXTERN).appendField(Et.Msg.MIXLY_ALL+Et.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(Et.ALIGN_RIGHT).appendField(Et.Msg.blynk_IOT_IR_POWER+Et.Msg.MIXLY_PINMODEOUT+Et.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},hl={init:function(){this.setColour(mr),this.appendDummyInput().appendField(Et.Msg.ANALOG+Et.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(Et.Msg.MIXLY_RELEASE).appendField(new Et.FieldDropdown([[Et.Msg.MICROPYTHON_DISPLAY_YES,"True"],[Et.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.ANALOG+Et.Msg.MIXLY_KEYBOARD_INPUT)}},ml={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SPECIAL_KEY).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[Et.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[Et.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[Et.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[Et.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[Et.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[Et.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[Et.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[Et.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Ol={init:function(){this.setColour(mr),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GENERAL_KEY).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},El={init:function(){this.setColour(mr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new Et.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(Et.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zm={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},$m={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Et.Msg.MIXLY_WIFI_USERNAME).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Et.Msg.MIXLY_IOT_PASSWORD).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Et.Msg.MIXLY_EMQX_PROJECT).setAlign(Et.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Et.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Et.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},eO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Et.Msg.MIXLY_EMQX_SUBSCRIBE+Et.Msg.MIXLY_MICROBIT_MSG).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Et.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_O={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Et.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},oO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Et.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},pO={init:function(){this.setColour(km),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},aO={init:function(){this.setColour(km),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},uO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},rO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO").appendField(Et.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Et.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},lO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+Et.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dO={init:function(){this.setColour(km),this.appendDummyInput().appendField(Et.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Et.Msg.MIXLY_EMQX_SERVER).setAlign(Et.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Et.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IO={init:function(){this.VISITOR_ID=Rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(km),this.appendDummyInput("").appendField(new Et.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},TO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MixIO").appendField(Et.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},MO={init:function(){this.setColour(km),this.appendDummyInput().appendField("HTTP"+Et.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Et.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Et.Msg.MIXLY_REQUESTS_GET).appendField(Et.Msg.MIXLY_GET_CURRENT_TIME).appendField(Et.Msg.MIXLY_OPEN_DEBUG).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hO={init:function(){this.setColour(km),this.appendDummyInput().appendField("HTTP"+Et.Msg.MIXLY_Client).appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Et.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Et.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MQTT"+Et.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Et.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Et.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Et.Msg.MQTT_Topic).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Et.Msg.MIXLY_OPEN_DEBUG).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Et.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},OO={init:function(){this.setColour(km),this.appendDummyInput().appendField("MQTT"+Et.Msg.MIXLY_Client).appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Et.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Et.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},EO=Hm,RO=Wm,cO=Km,gO=Jm,CO=zm,SO=225,AO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(Et.Msg.MIXLY_NETWORK_MODE).appendField(new Et.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},LO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[Et.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=Et.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:Et.Msg.MIXLY_NETWORK_WIFI_OPEN,False:Et.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},NO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},DO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:Et.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},fO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(Et.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(Et.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},FO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_NETWORK_WIFI_CONNECT+Et.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},PO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[Et.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[Et.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:Et.Msg.MIXLY_ESP32_NETWORK_IP,1:Et.Msg.MIXLY_ESP32_NETWORK_MASK,2:Et.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},vO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},YO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[Et.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},XO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(Et.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(Et.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},xO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},yO={init:function(){this.setColour(SO),this.appendValueInput("VAR").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new Et.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},VO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},bO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},BO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},GO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},UO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},wO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},kO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},HO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},WO={init:function(){this.setColour(SO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},KO={init:function(){this.setColour(SO),this.appendValueInput("DOMAIN").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_REQUESTS_GET).appendField(new Et.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},JO={init:function(){this.appendValueInput("VAL");var t=[[Et.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:Et.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Et.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Et.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},qO={init:function(){this.appendValueInput("VAR").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(Et.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:Et.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Et.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},zO={init:function(){this.setColour(SO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(Et.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QO={init:function(){this.setColour(SO),this.appendDummyInput("").appendField(new Et.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},jO="#3288dd",ZO={init:function(){this.setColour(jO),this.appendValueInput("URL").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(Et.Msg.blockpy_REQUESTS).appendField(Et.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},$O={init:function(){this.setColour(jO),this.appendValueInput("URL").appendField(Et.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Et.Msg.blockpy_CONDUCT).appendField(new Et.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(Et.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(Et.Msg.blockpy_REQUESTS+Et.Msg.OLED_STRING),this.appendDummyInput("").appendField(Et.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},tE={init:function(){this.appendValueInput("VAL");var t=[[Et.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Et.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Et.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(jO),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},eE="#A58C5B",iE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SENOR_IS_PRESSED)}},nE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SENOR_WAS_PRESSED)}},sE={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(Et.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.PROCEDURES_DEFRETURN_RETURN+Et.Msg.MIXLY_BUTTON+Et.Msg.MIXLY_GET_PRESSES)}},_E={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_BUTTON).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[Et.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[Et.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},oE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_shake,"shake"],[Et.Msg.MIXLY_UP,"up"],[Et.Msg.MIXLY_DOWN,"down"],[Et.Msg.MIXLY_LEFT,"left"],[Et.Msg.MIXLY_RIGHT,"right"],[Et.Msg.MIXLY_MICROBIT_face_up,"face up"],[Et.Msg.MIXLY_MICROBIT_face_down,"face down"],[Et.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=Et.Msg.MIXLY_MICROBIT_JS_CURRENT,n=Et.Msg.MSG.catSensor,s=Et.Msg.MIXLY_MICROBIT_JS_STATE,_=Et.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:Et.Msg.MIXLY_MICROBIT_shake,up:Et.Msg.MIXLY_UP,down:Et.Msg.MIXLY_DOWN,left:Et.Msg.MIXLY_LEFT,right:Et.Msg.MIXLY_RIGHT,"face up":Et.Msg.MIXLY_MICROBIT_face_up,"face down":Et.Msg.MIXLY_MICROBIT_face_down,freefall:Et.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},pE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},aE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},uE={init:function(){var t=[[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(eE),this.appendValueInput("PIN",Number).appendField(new Et.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new Et.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:Et.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},rE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},lE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},dE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"left"],[Et.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(Et.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=Et.Msg.MIXLY_ESP32_NEAR;return i+{left:Et.Msg.TEXT_TRIM_LEFT,right:Et.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},IE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[Et.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":Et.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":Et.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},TE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[Et.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},ME={init:function(){this.setColour(eE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},hE={init:function(){this.setColour(eE),this.appendDummyInput("").appendField("LM35"+Et.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Et.Msg.MIXLY_TOOLTIP_LM35)}},mE={init:function(){this.setColour(eE),this.appendValueInput("I2CSUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Et.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},OE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[Et.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[Et.Msg.MIXLY_ESP32_MAX30102_IR+","+Et.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[Et.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[Et.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},RE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},cE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.HTML_COLOUR+Et.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET+Et.Msg.HTML_COLOUR,"[2]"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_IR_STRENGTH,"[1]"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},gE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.HTML_COLOUR+Et.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET+"RGB"+Et.Msg.HTML_COLOUR,"0"],[Et.Msg.MIXLY_GET+Et.Msg.MIXLY_RGB_RAW,"1"],[Et.Msg.MIXLY_GET_ENV_LIGHT+Et.Msg.MIXLY_BRIGHTNESS,"2"],[Et.Msg.GET_IR_STRENGTH+Et.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},CE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GET_ENV_LIGHT,"E"],[Et.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},SE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},AE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},LE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},NE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},fE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MIXGOPE_FIELD+Et.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[Et.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},FE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_shake,"shake"],[Et.Msg.MIXLY_UP,"up"],[Et.Msg.MIXLY_DOWN,"down"],[Et.Msg.MIXLY_LEFT,"left"],[Et.Msg.MIXLY_RIGHT,"right"],[Et.Msg.MIXLY_MICROBIT_face_up,"face up"],[Et.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=Et.Msg.MIXLY_MICROBIT_JS_CURRENT,n=Et.Msg.MSG.catSensor,s=Et.Msg.MIXLY_MICROBIT_JS_STATE,_=Et.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:Et.Msg.MIXLY_MICROBIT_shake,up:Et.Msg.MIXLY_UP,down:Et.Msg.MIXLY_DOWN,left:Et.Msg.MIXLY_LEFT,right:Et.Msg.MIXLY_RIGHT,"face up":Et.Msg.MIXLY_MICROBIT_face_up,"face down":Et.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},PE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},vE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_GET+Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},YE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Et.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new Et.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Et.Msg.MIXLY_MICROBIT_Direction,s=Et.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":Et.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},XE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},xE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_GETTEMPERATUE)}},yE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return Et.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:Et.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:Et.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},VE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},bE={init:function(){this.setColour(eE),this.appendValueInput("SPISUB").appendField(Et.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Et.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP+Et.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Et.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},BE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[Et.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},GE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},UE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},wE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kE={init:function(){this.setColour(eE),this.appendDummyInput().appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(Et.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},HE={init:function(){this.setColour(eE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_SCAN_OK,"0"],[Et.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[Et.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},WE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Et.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},KE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},JE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qE={init:function(){this.setColour(eE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Et.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},eD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},nD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},_D=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},oD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},pD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},aD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},uD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},rD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},lD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},dD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},TD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},MD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},hD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},mD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},OD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},ED=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},RD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},cD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},gD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},CD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},SD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},AD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},LD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},ND=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},DD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},fD=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},FD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},PD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},vD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},YD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},XD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},xD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},yD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},VD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},bD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},BD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},GD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},UD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},wD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},kD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},HD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},WD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},KD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},JD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Rt.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},qD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},zD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},QD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},ZD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},tf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},nf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},sf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},_f=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},of=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},pf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},af=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},uf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},rf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},lf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},df=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},If=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},Tf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},Mf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},hf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},mf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Of=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Qf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},jf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Zf=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},$f=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},tF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},eF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},iF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},nF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},sF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},_F=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},oF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},pF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},aF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},uF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},rF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},lF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},dF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},IF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},TF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},MF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},hF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},mF=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},OF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},EF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},RF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Mx=function(){return"control.reset()\n"},hx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+")\n"},mx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+")\n"},Ox=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Rt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Ex=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Rx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},cx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},gx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Cx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Sx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Ax=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Lx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Nx=function(){return"while True:\n pass\n"},Dx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},fx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Fx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Px=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},vx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Yx=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Xx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},xx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},yx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},Vx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},bx=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},Bx=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Gx=xx,Ux=Yx,wx=Xx,kx=Fx,Hx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Kx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Jx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},$x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ty=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ny=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},sy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},_y={};_y["MixGo MINI"]={description:"MicroPython[ESP32C3 MixGo MINI]",digital_pin:Rt.Profile.generate(["0-10","18"]),input_pin:Rt.Profile.generate(["0-10","18"]),output_pin:Rt.Profile.generate(["0-10","18"]),pwm_input:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_input:Rt.Profile.generate(["0-4"],"adc","adc"),pwm_output:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_output:Rt.Profile.generate(["0-4"],"adc","adc"),espnow_channel:Rt.Profile.generate(["1-13"]),haskylens_model:Rt.Profile.generate(["0-4"]),digital:Rt.Profile.generate(["0-10","18"],"pin","pin"),pwm_pin:Rt.Profile.generate(["0-10","18"]),pwm:Rt.Profile.generate(["0-10","18"],"pwm","pwm"),analog_pin:Rt.Profile.generate(["0-4"]),analog:Rt.Profile.generate(["0-4"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Rt.Profile.generate(["0-4"]),exlcdh:Rt.Profile.generate(["0-11"]),exlcdv:Rt.Profile.generate(["0-7"]),brightness:Rt.Profile.generate(["0-9"]),tts_voice:Rt.Profile.generate(["0-16"]),tts_builtin_music:Rt.Profile.generate(["0-47"]),tts_bgmusic:Rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["ANGRY","onboard_matrix.ANGRY"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["DOOR_OPEN","onboard_matrix.DOOR_OPEN"],["DOOR_OPENING","onboard_matrix.DOOR_OPENING"],["DOOR_CLOSE","onboard_matrix.DOOR_CLOSE"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["BIRTHDAY","onboard_music.BIRTHDAY"],["BA_DING","onboard_music.BA_DING"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},_y["ESP32C2 Generic(2M)"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Rt.Profile.generate(["0-11","18-21"]),input_pin:Rt.Profile.generate(["0-11","18-21"]),output_pin:Rt.Profile.generate(["0-11","18-21"]),pwm_input:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Rt.Profile.generate(["0-5"],"adc","adc"),pwm_output:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Rt.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Rt.Profile.generate(["1-13"]),haskylens_model:Rt.Profile.generate(["0-4"]),digital:Rt.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Rt.Profile.generate(["0-11","18-21"]),pwm:Rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Rt.Profile.generate(["0-5"]),analog:Rt.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Rt.Profile.generate(["0-4"]),exlcdh:Rt.Profile.generate(["0-31"]),exlcdv:Rt.Profile.generate(["0-11"]),brightness:Rt.Profile.generate(["0-9"]),tts_voice:Rt.Profile.generate(["0-16"]),tts_builtin_music:Rt.Profile.generate(["0-47"]),tts_bgmusic:Rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const oy=_y,py=20,ay={init:function(){this.setColour(py),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_HIGH,"HIGH"],[Et.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},uy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(Et.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},ry={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},ly={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField("DAC"+Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},dy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_mSecond,"period"],[Et.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Iy={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_REF_VOLTAGE+Et.Msg.MIXLY_STAT).appendField(new Et.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},Ty={init:function(){this.setColour(py),this.appendValueInput("pin").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Et.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(Et.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},My={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MODE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[Et.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[Et.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},hy={init:function(){this.setColour(20),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROPYTHON_AS).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[Et.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[Et.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[Et.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},my={init:function(){this.setColour(py),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("dac#"),"PIN_OBJ").appendField(Et.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+Et.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Oy={init:function(){this.setColour(py),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP).appendField(new Et.FieldTextInput("tc#"),"PIN_OBJ").appendField(Et.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(Et.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){Et.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Ey={init:function(){this.setColour(py),this.appendValueInput("PIN",Number).appendField("PWM"+Et.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(Et.Msg.MIXLY_FREQUENCY+Et.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Et.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},Ry=hy,cy=Oy,gy=Ty,Cy=My,Sy=40,Ay={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput("").appendField(t).appendField(Et.Msg.MIXLY_TEM_HUM+" AHT21").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Et.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("key");return{temperature:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:Et.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[t]}))}},Ly={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput("").appendField(t).appendField(Et.Msg.MIXLY_Altitude+Et.Msg.MSG.catSensor+" HP203X").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_GETPRESSURE,"pressure()"],[Et.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[Et.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ny={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},Dy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendDummyInput("").appendField(Et.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},fy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"+Et.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,Number),this.setInputsInline(!0)}},Fy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Py={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField(Et.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(Et.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(Et.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(Et.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0)}},vy={init:function(){if("mixgo_me"==Rt.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(Sy),this.appendDummyInput().appendField(t).appendField("RFID"),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_RFID_SCAN_OK,"True"],[Et.Msg.MIXLY_RFID_SCAN_NOTAGERR,"None"],[Et.Msg.MIXLY_RFID_SCAN_ERROR,"False"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Yy=100,Xy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.MIXGO_LEFT_FRONT+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[0]"],[Et.Msg.MIXGO_RIGHT_FRONT+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[1]"],[Et.Msg.MIXGO_LEFT_BACK+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[3]"],[Et.Msg.MIXGO_RIGHT_BACK+Et.Msg.COLOUR_RGB_GREEN+Et.Msg.MIXLY_EXTERN_LED,"GLED[2]"],[Et.Msg.MIXGO_LEFT_FRONT+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[0]"],[Et.Msg.MIXGO_RIGHT_FRONT+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[1]"],[Et.Msg.MIXGO_LEFT_BACK+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[3]"],[Et.Msg.MIXGO_RIGHT_BACK+Et.Msg.COLOUR_RGB_RED+Et.Msg.MIXLY_EXTERN_LED,"RLED[2]"],[Et.Msg.ME_GO_LIGHT_HEADLIGHT,"WLED"]]),"op"),this.setOutput(!0)}},xy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField("ME GO"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_SETONOFF)}},yy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField("ME GO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},Vy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField("ME GO"),this.appendDummyInput().appendField(Et.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_ESP32_LED_GETONOFF)}},by={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField("ME GO"),this.appendValueInput("bright").appendField(Et.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Et.Msg.MIXLY_SETTING+Et.Msg.MIXLY_BUILDIN_LED+Et.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},By={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(new Et.FieldDropdown([[Et.Msg.blockpy_forward,"F"],[Et.Msg.blockpy_backward,"B"],[Et.Msg.blockpy_left,"L"],[Et.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Gy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(new Et.FieldDropdown([[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Uy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField("ME GO").appendField(Et.Msg.MOTOR_DC).appendField(new Et.FieldDropdown([[Et.Msg.MIXLYCAR_WHEEL_LEFT,"0"],[Et.Msg.MIXLYCAR_WHEEL_RIGHT,"1"],[Et.Msg.ME_GO_MOTOR_EXTERN,"2"]]),"wheel"),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_Direction).appendField(new Et.FieldDropdown([[Et.Msg.ROTATION_FORWARD,"CW"],[Et.Msg.ROTATION_BACKWARD,"CCW"],[Et.Msg.MOTOR_P,"P"],[Et.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Et.inputs.Align.RIGHT).appendField(Et.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.MIXLY_ESP32_INTERRUPT).appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendValueInput("DO").appendField(Et.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ky={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_SETUP),this.appendDummyInput("").appendField(new Et.FieldDropdown([["turns","turns"],["distance","distance"],["turns,distance","all"]]),"args"),this.appendValueInput("num").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Hy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.ME_GO_HALL_SENSOR),this.appendDummyInput("").appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"A"],[Et.Msg.TEXT_TRIM_RIGHT,"B"]]),"mode"),this.appendDummyInput("").appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("").appendField(new Et.FieldDropdown([["turns","turns"],["distance","distance"],["speed","speed"]]),"args"),this.setOutput(!0),this.setInputsInline(!0)}},Wy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"[0]"],[Et.Msg.MIXGO_LEFT_MID,"[1]"],[Et.Msg.MIXGO_RIGHT_MID,"[2]"],[Et.Msg.TEXT_TRIM_RIGHT,"[3]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXGO_LINE_SENSOR_VAL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ESP32_NEAR}))}},Ky={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.MIXGO_LEFT_FRONT,"[0]"],[Et.Msg.MIXGO_RIGHT_FRONT,"[1]"],[Et.Msg.MIXGO_LEFT_BACK,"[3]"],[Et.Msg.MIXGO_RIGHT_BACK,"[2]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXGO_PROXIMITY_SENSOR),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ESP32_NEAR}))}},Jy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MIXGO_CAR_SENSOR_ONBOARD_CHANGE).appendField(new Et.FieldDropdown([[Et.Msg.MIXLY_ME_GO_CAR_SENSOR_ONBOARD_AUTO_CHANGE,"AS"],[Et.Msg.MIXLY_MIXGO_CAR_USE_LINE_ONLY,"LP"],[Et.Msg.MIXLY_MIXGO_CAR_USE_PROXIMITY_ONLY,"OA"],[Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_ONLY,"LS"],[Et.Msg.ME_GO_SENSOR_MODE_OFF,"CL"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qy={init:function(){this.setColour(Yy),this.appendDummyInput("").appendField(Et.Msg.MIXLY_GET_GESTURE).appendField(new Et.FieldDropdown([[Et.Msg.ME_GO_PITCH,"[0]"],[Et.Msg.ME_GO_ROLL,"[1]"],[Et.Msg.ME_GO_PITCH+", "+Et.Msg.ME_GO_ROLL,""]]),"angle"),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},zy={init:function(){this.setColour(Yy),this.appendDummyInput().appendField(Et.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Et.FieldDropdown([[Et.Msg.TEXT_TRIM_LEFT,"[0]"],[Et.Msg.MIXGO_LEFT_MID,"[1]"],[Et.Msg.MIXGO_RIGHT_MID,"[2]"],[Et.Msg.TEXT_TRIM_RIGHT,"[3]"],[Et.Msg.MIXLY_ALL,""]]),"key").appendField(Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return Et.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+Et.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR}))}},Qy=230,jy={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital),"PIN"),this.setOutput(!0)}},Zy={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},tV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},eV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},iV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},nV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},sV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},_V={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},oV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},pV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},aV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},uV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},rV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},lV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},dV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},IV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog),"PIN"),this.setOutput(!0)}},TV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},MV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.dac),"PIN"),this.setOutput(!0)}},hV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},mV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},OV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},EV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},RV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},cV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},gV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.touch),"PIN"),this.setOutput(!0)}},CV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},SV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},AV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},LV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},NV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},DV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},fV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},FV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},PV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},vV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},YV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},XV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},xV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},yV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},VV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},bV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},BV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},GV={init:function(){this.setColour(Qy),this.appendDummyInput("").appendField(new Et.FieldDropdown(Rt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},UV=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},wV=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},kV=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},HV=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},WV=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},KV=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},JV=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},qV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},zV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},QV=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},jV=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,Et.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},ZV=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mini_g2="import mini_g2",["mini_g2.ext_ahtx0."+i+"()",e.ORDER_ATOMIC]},$V=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mini_g2="import mini_g2",["mini_g2.ext_hp203x."+i,e.ORDER_ATOMIC]},tb=function(t,e){e.definitions_.import_mini_g2="import mini_g2";return["mini_g2.varistor()",e.ORDER_ATOMIC]},eb=function(t,e){if(e.definitions_.import_mini_g2="import mini_g2","mixgo_mini"==Rt.Boards.getSelectedBoardKey().split(":")[2]){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var i='ext_rfid.read_card(0, x="id")'}else{e.definitions_.import_mini_g2="import mini_g2";i='mini_g2.ext_rc522.read_card(0, x="id")'}return[i,e.ORDER_ATOMIC]},ib=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var s="ext_rfid.read_card("+n+")"}else{e.definitions_.import_mini_g2="import mini_g2";s="mini_g2.ext_rc522.read_card("+n+")"}return[s,e.ORDER_ATOMIC]},nb=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var _="ext_rfid.write_card("+s+","+n+")\n"}else{e.definitions_.import_mini_g2="import mini_g2";_="mini_g2.ext_rc522.write_card("+s+","+n+")\n"}return _},sb=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var _="ext_rfid.write_card("+s+","+n+")"}else{e.definitions_.import_mini_g2="import mini_g2";_="mini_g2.ext_rc522.write_card("+s+","+n+")"}return[_,e.ORDER_ATOMIC]},_b=function(t,e){var i=Rt.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");if("mixgo_mini"==i){e.definitions_.import_mini_g2_ext_rfid="from mini_g2 import ext_rfid";var s="ext_rfid.scan_card()=="+n}else{e.definitions_.import_mini_g2="import mini_g2";s="mini_g2.ext_rc522.scan_card()=="+n}return[s,e.ORDER_ATOMIC]},ob=function(t,e){return e.definitions_.import_me_go_car="from me_go import car",["car."+this.getFieldValue("op"),e.ORDER_ATOMIC]},pb=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car","car.setonoff("+i+","+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},ab=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car",["car.getrightness("+i+")",e.ORDER_ATOMIC]},ub=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car",["car.getonoff("+i+")",e.ORDER_ATOMIC]},rb=function(t,e){var i=e.valueToCode(this,"led",e.ORDER_ATOMIC);return e.definitions_.import_me_go_car="from me_go import car","car.setbrightness("+i+","+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},lb=function(t,e){var i=this.getFieldValue("VAR");return e.definitions_.import_me_go_car="from me_go import car",'car.move("'+i+'",'+e.valueToCode(this,"speed",e.ORDER_ASSIGNMENT)+")\n"},db=function(t,e){var i=this.getFieldValue("VAR");return e.definitions_.import_me_go_car="from me_go import car",'car.move("'+i+'")\n'},Ib=function(t,e){var i=this.getFieldValue("wheel");e.definitions_.import_me_go_car="from me_go import car";var n=this.getFieldValue("direction");return 0==i&&("CW"==n?n="CCW":"CCW"==n&&(n="CW")),"car.motor(car.MOTO["+i+'],"'+n+'",'+e.valueToCode(this,"speed",e.ORDER_ATOMIC)+")\n"},Tb=function(t,e){var i=this.getFieldValue("mode");return e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i,"hall_"+i+".irq_cb("+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+")\n"},Mb=function(t,e){var i=this.getFieldValue("mode"),n=this.getFieldValue("args");e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i;var s=e.valueToCode(this,"num",e.ORDER_ATOMIC);return"all"==n?"hall_"+i+".initial(turns="+s+",distance="+s+")\n":"hall_"+i+".initial("+n+"="+s+")\n"},hb=function(t,e){var i=this.getFieldValue("mode"),n=this.getFieldValue("args");return e.definitions_["import_me_go_hall_"+i]="from me_go import hall_"+i,["hall_"+i+"."+n,e.ORDER_ATOMIC]},mb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.patrol()"+i,e.ORDER_ATOMIC]},Ob=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.obstacle()"+i,e.ORDER_ATOMIC]},Eb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car","car.ir_mode(car."+i+")\n"},Rb=function(t,e){return e.definitions_.import_mixgo_me_onboard_mxc6655xa="from mixgo_me import onboard_mxc6655xa",["onboard_mxc6655xa.eulerangles(upright=True)"+this.getFieldValue("angle"),e.ORDER_ATOMIC]},cb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_go_hall="from me_go import car",["car.light()"+i,e.ORDER_ATOMIC]},gb=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Cb=gb,Sb=gb,Ab=gb,Lb=gb,Nb=gb,Db=gb,fb=gb,Fb=gb,Pb=gb,vb=gb,Yb=gb,Xb=gb,xb=gb,yb=gb,Vb=gb,bb=gb,Bb=gb,Gb=gb,Ub=gb,wb=gb,kb=gb,Hb=gb,Wb=gb,Kb=gb,Jb=gb,qb=gb,zb=gb,Qb=gb,jb=gb,Zb=gb,$b=gb,tB=gb,eB=gb,iB=gb,nB=gb,sB=gb,_B=gb,oB=gb,pB=gb,aB=gb,uB=gb,rB=gb,lB=gb,dB=gb;Object.assign(Et.Variables,gt),Object.assign(Et.Procedures,es),Et.Python=Cu,Et.generator=Cu,Rt.Profile.default={},Object.assign(Rt.Profile,oy),Object.assign(Rt.Profile.default,oy["MixGo CC"]),Object.assign(Et.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,b,H,k,X,B,W,f,w,U,G,F,D,N,y,x,V,P,v,Y,lt,dt,It,Tt),Object.assign(Et.Python.forBlock,T,M,h,m,O,E,R,c,g,C,S,A,L,nt,ut,at,$,st,rt,q,pt,ot,_t,z,J,K,et,tt,it,Q,j,Z,Mt,ht,mt,Ot)})(); \ No newline at end of file diff --git a/boards/default/micropython_esp32c3/main.bundle.js b/boards/default/micropython_esp32c3/main.bundle.js index 1d38b7ab..25efb9cb 100644 --- a/boards/default/micropython_esp32c3/main.bundle.js +++ b/boards/default/micropython_esp32c3/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Gt={init:function(){this.setColour(Xt),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ut={init:function(){this.setColour(Xt),this.appendValueInput("LIST").setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(mt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wt={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new mt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(mt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ht={init:function(){this.setColour(Xt);var t=new mt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Wt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};wt.OPERATORS=[[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Ht.OPERATORS=[[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},$t={init:function(){this.jsonInit({message0:mt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Xt,tooltip:mt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:mt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},te={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_STAT),this.setOutput(!0)}},ee={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},ie={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ne={init:function(){this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(mt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new mt.FieldDropdown([[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Xt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},se={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_e={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},oe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},pe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ae={init:function(){this.setColour(Xt),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(mt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ue=230;mt.FieldTextInput.math_number_validator=function(t){return String(t)},mt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const re={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},le={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},de={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ie={init:function(){this.setColour(ue),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Te={init:function(){this.setColour(ue),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Me={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new mt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},he={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:mt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:mt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:mt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:mt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:mt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:mt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:mt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},me={init:function(){var t=[[mt.Msg.MATH_BIN,"bin"],[mt.Msg.MATH_OCT,"oct"],[mt.Msg.MATH_HEX,"hex"]];this.setColour(ue),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:mt.Msg.MATH_DEC_TOOLTIP_BIN,oct:mt.Msg.MATH_DEC_TOOLTIP_OCT,hex:mt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ee={init:function(){var t=[[mt.Msg.LANG_MATH_TO_ROUND,"round"],[mt.Msg.LANG_MATH_TO_CEIL,"ceil"],[mt.Msg.LANG_MATH_TO_FLOOR,"floor"],[mt.Msg.MATH_ABS,"fabs"],[mt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:mt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:mt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:mt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:mt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:mt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:mt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Oe={init:function(){var t=[[mt.Msg.MIXLY_MAX,"max"],[mt.Msg.MIXLY_MIN,"min"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(mt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:mt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:mt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Re={init:function(){var t=[[mt.Msg.MATH_TWO,"two"],[mt.Msg.MATH_EIGHT,"eight"],[mt.Msg.MATH_TEN,"ten"],[mt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ue),this.appendDummyInput("").appendField(mt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new mt.FieldDropdown(t),"OP").appendField(mt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MATH_ZHW).appendField(new mt.FieldDropdown(t),"OP2").appendField(mt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:mt.Msg.MATH_Before_two,eight:mt.Msg.MATH_Before_eight,ten:mt.Msg.MATH_Before_ten,sixteen:mt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:mt.Msg.MATH_Behind_two,eight:mt.Msg.MATH_Behind_eight,ten:mt.Msg.MATH_Behind_ten,sixteen:mt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},ce={init:function(){var t=[[mt.Msg.LANG_MATH_INT,"int"],[mt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ue),this.setOutput(!0,Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new mt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:mt.Msg.LANG_MATH_INT,float:mt.Msg.LANG_MATH_FLOAT_RANDOM};return mt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ce={init:function(){this.setColour(ue),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(mt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(mt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Se={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},Ae={init:function(){this.setColour(ue),this.appendValueInput("NUM").setCheck(Number).appendField(mt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Le={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MATH_ROUND).appendField(mt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(mt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ne={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"],[mt.Msg.MIXLY_TO_BITES,"b"],[mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:mt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},De={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:mt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},fe=Ce,Fe={init:function(){this.setColour(ue),this.appendValueInput("VAR").appendField(mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Pe={init:function(){this.setColour(ue),this.itemCount_=1,this.setMutator(new mt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(mt.Msg.MIXLY_PRODUCT+mt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(mt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(mt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const xe={init:function(){this.setColour(ve),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new mt.FieldTextInput("",mt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(mt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new mt.FieldImage(e,7,12,'"')}},ye={init:function(){this.setColour(ve),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(mt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},be={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ve={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String).appendField(mt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Be={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ge={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ue={init:function(){this.WHERE_OPTIONS=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.TEXT_GET_INDEX_RANDOM+1+mt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.LISTS_GET_INDEX_GET,"MODE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(mt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+mt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",mt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:mt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:mt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:mt.Msg.TEXT_GET_INDEX_RANDOM};return mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+mt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==mt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new mt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},we={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.LISTS_GET_INDEX_FROM_START+"n"+mt.Msg.TEXT_CHARAT2)}},ke={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(mt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(mt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},He={init:function(){this.WHERE_OPTIONS_1=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[mt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==mt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new mt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},We={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(mt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ke={init:function(){var t=[[mt.Msg.MIXLY_EQUALS,"==="],[mt.Msg.MIXLY_STARTSWITH,"startswith"],[mt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new mt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Je={init:function(){this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_COMPARETO_HELP)}},Qe={init:function(){var t=[[mt.Msg.TEXT_UPPER,"upper"],[mt.Msg.TEXT_TITLE,"title"],[mt.Msg.TEXT_CAPITALIZE,"capitalize"],[mt.Msg.TEXT_SWAPCASE,"swapcase"],[mt.Msg.TEXT_LOWER,"lower"]];this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:mt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:mt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:mt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:mt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:mt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},qe={init:function(){var t=[[mt.Msg.TEXT_LJUST,"ljust"],[mt.Msg.TEXT_CENTER,"center"],[mt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ve),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(mt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(mt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(mt.Msg.MIXLY_MID+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(mt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},je={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(mt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},$e={init:function(){this.setColour(ve),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(mt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(mt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ti={init:function(){var t=[[mt.Msg.TEXT_TRIM_BOTH,"strip"],[mt.Msg.TEXT_TRIM_LEFT,"lstrip"],[mt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ve),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(mt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:mt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:mt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:mt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ei={init:function(){this.setColour(ve),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new mt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zi={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ji={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zi={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_KEYS),this.setTooltip(mt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_TOOLTIP)}},tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},en={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},nn={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_DELETE_TOOLTIP)}},sn={init:function(){this.setColour(Qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(mt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(mt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MID),this.setTooltip(mt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_n={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_CLEAR),this.setTooltip(mt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},on={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_ITEMS),this.setTooltip(mt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},pn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_VALUES),this.setTooltip(mt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},an={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LENGTH),this.setTooltip(mt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},un={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_DELDICT),this.setTooltip(mt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rn={init:function(){this.MODE=[[mt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[mt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(mt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=mt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=mt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new mt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},ln={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setTooltip(mt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},In={init:function(){this.setColour(Qi),this.appendDummyInput("").appendField(new mt.FieldLabel(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new mt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Tn={init:function(){this.setColour(Qi),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TO_JSON),this.setTooltip(mt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},hn={init:function(){this.setColour(Qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En=210,On={init:function(){var t=mt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:mt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:mt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Rn={init:function(){var t=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new mt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},cn={init:function(){var t=[[mt.Msg.LOGIC_OPERATION_AND,"AND"],[mt.Msg.LOGIC_OPERATION_OR,"OR"],[mt.Msg.LOGIC_OPERATION_NOR,"NOR"],[mt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:mt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:mt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(mt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(mt.Msg.LOGIC_NEGATE_TOOLTIP)}},Cn={init:function(){var t=[[mt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[mt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new mt.FieldDropdown(t),"BOOL"),this.setTooltip(mt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Sn={init:function(){this.setColour(En),this.setOutput(!0),this.appendDummyInput().appendField(mt.Msg.LOGIC_NULL),this.setTooltip(mt.Msg.LOGIC_NULL_TOOLTIP)}},An={init:function(){this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(mt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(mt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Ln={init:function(){var t=[[mt.Msg.TEXT_APPEND_TO,"in"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new mt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(mt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.IN)}},Nn={init:function(){var t=[[mt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Dn={init:function(){this.setColour(En),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},fn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(mt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXPY_TEXT_ENCODE).appendField(new mt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MICROBIT_PYTHON_TYPE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.HTML_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Gn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Kn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+mt.Msg.MIXLY_ESP32_SET+{mkdir:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(mt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.HTML_FILE,"isfile"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(mt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(mt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Zn={};Zn.NAME_TYPE=mt.PROCEDURE_CATEGORY_NAME,Zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_FORM_CONTENT).appendField(new mt.FieldDropdown([[mt.Msg.HTML_TEXT,"text"],[mt.Msg.HTML_EMAIL,"email"],[mt.Msg.HTML_NUMBER,"number"],[mt.Msg.HTML_PASSWORD,"password"],[mt.Msg.HTML_CHECKBOX,"checkbox"],[mt.Msg.HTML_RADIOBUTTON,"radiobutton"],[mt.Msg.HTML_BUTTON,"button"],[mt.Msg.HTML_COLOUR,"colour"],[mt.Msg.HTML_DATE,"date"],[mt.Msg.HTML_LOCALTIME,"local time"],[mt.Msg.HTML_FILE,"file"],[mt.Msg.HTML_HIDDEN,"hidden"],[mt.Msg.HTML_IMAGE,"image"],[mt.Msg.HTML_MONTH,"month"],[mt.Msg.HTML_RANGE,"range"],[mt.Msg.HTML_RESET,"reset"],[mt.Msg.HTML_SEARCH,"search"],[mt.Msg.HTML_SUBMIT,"submit"],[mt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[mt.Msg.HTML_TIME,"time"],[mt.Msg.HTML_URL,"url"],[mt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(mt.Msg.HTML_NAME).appendField(new mt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(mt.Msg.HTML_VALUE).appendField(new mt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_TEXT).appendField(new mt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs=160,$s={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new mt.FieldTable(""),"TEXT")}},t_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT")}},e_={init:function(){this.setColour(Zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},i_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},n_={init:function(){this.setColour(Zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new mt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},s_={init:function(){this.setColour(Zs),this.appendValueInput("VALUE").appendField(mt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},__={init:function(){this.setColour(Zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(mt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=mt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},mt.isNumber(n)&&mt.isNumber(s)&&mt.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const qp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},jp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Zp=function(t,e){return["None",e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ta=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ia=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},na=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},sa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},_a=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},oa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},pa=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},aa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ua=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ma=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ea=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Sa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},La=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),mt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ru=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lu=function(t,e){return'"},du=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Iu=function(){return this.getFieldValue("TEXT")+"\n"},Tu=function(t){return t.getFieldValue("TEXT")+"\n"},Mu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},hu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},mu=function(){return""},Eu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ou=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},cu.scrubNakedValue=function(t){return t+"\n"},cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=mt.utils.string.wrap(_,cu.COMMENT_WRAP-3),n+=cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const gu="#74A55B",Cu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Su={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Au={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Lu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Nu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Du={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},vu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Yu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Xu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},xu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},bu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField("360°"+mt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SETTING+mt.Msg.blockpy_turtle_rotate+mt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Vu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Gu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Uu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},wu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new mt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(mt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},ku={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[mt.Msg.MOTOR_N,"ms32006.MOT_N"],[mt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Hu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new mt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Wu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Ku={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Ju={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new mt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+mt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ju={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},$u={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},tr={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},er={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},nr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LISTS_SET_INDEX_SET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},_r={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},or={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[mt.Msg.MIXLY_SPEED,"[1]"],[mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[mt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[mt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[mt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ar={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Mr="#6C9858",hr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},mr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_ON,"1"],[mt.Msg.MIXLY_ESP32_OFF,"0"],[mt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Er={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Or={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},cr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},gr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LCD_SETCOLOR).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LIGHT_RED,"1"],[mt.Msg.MIXLY_LIGHT_GREEN,"2"],[mt.Msg.MIXLY_LIGHT_BLUE,"3"],[mt.Msg.MIXLY_LIGHT_YELLOW,"4"],[mt.Msg.MIXLY_LIGHT_CYAN,"5"],[mt.Msg.MIXLY_LIGHT_PURPLE,"6"],[mt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Sr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ar={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Lr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Nr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Dr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},fr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Fr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Pr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},vr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Yr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Xr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},xr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},yr={init:function(){this.setColour(Mr),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},br={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Vr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Br={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Gr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ur={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wr={init:function(){this.setColour(Mr),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},kr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Kr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},qr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},jr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"1"],[mt.Msg.TEXT_TRIM_RIGHT,"2"],[mt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},el={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"0"],[mt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(Mr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(Mr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_RECORD_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},al={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},rl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ll={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},dl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Il={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.MIXLY_ALL+mt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(mt.ALIGN_RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Tl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(mt.Msg.MIXLY_RELEASE).appendField(new mt.FieldDropdown([[mt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[mt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT)}},Ml={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SPECIAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[mt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[mt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[mt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[mt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[mt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[mt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},hl={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GENERAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ml={init:function(){this.setColour(Mr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new mt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(mt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(mt.Msg.MIXLY_WIFI_USERNAME).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(mt.Msg.MIXLY_IOT_PASSWORD).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_PROJECT).setAlign(mt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(mt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},$m={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_SUBSCRIBE+mt.Msg.MIXLY_MICROBIT_MSG).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(mt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},tE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},sE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},_E={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},oE={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},pE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},aE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(mt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},uE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+mt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lE={init:function(){this.VISITOR_ID=Et.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Um),this.appendDummyInput("").appendField(new mt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},dE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},IE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(mt.Msg.MIXLY_REQUESTS_GET).appendField(mt.Msg.MIXLY_GET_CURRENT_TIME).appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},ME={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(mt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(mt.Msg.MQTT_Topic).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mE=wm,EE=km,OE=Hm,RE=Wm,cE=Jm,gE=225,CE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(mt.Msg.MIXLY_NETWORK_MODE).appendField(new mt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},SE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[mt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=mt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:mt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:mt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},AE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},LE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:mt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},NE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(mt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(mt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},DE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_CONNECT+mt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},fE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[mt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:mt.Msg.MIXLY_ESP32_NETWORK_IP,1:mt.Msg.MIXLY_ESP32_NETWORK_MASK,2:mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},FE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},PE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},vE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(mt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},YE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},XE={init:function(){this.setColour(gE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new mt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},xE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},yE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},bE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},VE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},BE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},GE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},UE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},wE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},kE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},HE={init:function(){this.setColour(gE),this.appendValueInput("DOMAIN").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS_GET).appendField(new mt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},WE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:mt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:mt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:mt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},KE={init:function(){this.appendValueInput("VAR").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:mt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:mt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},JE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(mt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(new mt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},qE="#3288dd",zE={init:function(){this.setColour(qE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS).appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},jE={init:function(){this.setColour(qE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(mt.Msg.blockpy_REQUESTS+mt.Msg.OLED_STRING),this.appendDummyInput("").appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},ZE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[mt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(qE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},$E="#A58C5B",tO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_IS_PRESSED)}},eO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_WAS_PRESSED)}},iO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_BUTTON+mt.Msg.MIXLY_GET_PRESSES)}},nO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},sO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"],[mt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down,freefall:mt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},_O={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},oO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},pO={init:function(){var t=[[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour($E),this.appendValueInput("PIN",Number).appendField(new mt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},aO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},uO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},rO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"left"],[mt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(mt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=mt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=mt.Msg.MIXLY_ESP32_NEAR;return i+{left:mt.Msg.TEXT_TRIM_LEFT,right:mt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},lO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[mt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},dO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[mt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},IO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField("DS18X20 "+mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},TO={init:function(){this.setColour($E),this.appendDummyInput("").appendField("LM35"+mt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LM35)}},MO={init:function(){this.setColour($E),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},hO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[mt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[mt.Msg.MIXLY_ESP32_MAX30102_IR+","+mt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},mO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[mt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[mt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},OO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+mt.Msg.HTML_COLOUR,"[2]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_IR_STRENGTH,"[1]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},RO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+"RGB"+mt.Msg.HTML_COLOUR,"0"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_RGB_RAW,"1"],[mt.Msg.MIXLY_GET_ENV_LIGHT+mt.Msg.MIXLY_BRIGHTNESS,"2"],[mt.Msg.GET_IR_STRENGTH+mt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},cO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[mt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},gO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},CO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},SO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},AO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},NO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MIXGOPE_FIELD+mt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[mt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},fO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},FO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET+mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},PO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+mt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},vO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},YO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_GETTEMPERATUE)}},XO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},xO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},yO={init:function(){this.setColour($E),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},bO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[mt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},VO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},BO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},GO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},UO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},wO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},kO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},HO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},WO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},KO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},$N=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},tD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},eD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},nD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},_D=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},oD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},pD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},aD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},uD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},rD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},lD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},dD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ID=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},TD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},MD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},hD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},mD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},ED=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},OD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},RD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},gD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},CD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},SD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},AD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},LD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},ND=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},DD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},fD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},FD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},PD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},vD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Et.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},YD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},XD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},xD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},yD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},bD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},VD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},BD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},GD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},UD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},wD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},kD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},HD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},WD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Et.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},KD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},JD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},QD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},qD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},zD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ZD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},tf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},nf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},sf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},_f=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},of=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},pf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},af=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},rf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},lf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},df=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},If=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},Tf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Mf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},hf=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Qf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},qf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},zf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},jf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Zf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},$f=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},tF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},eF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},iF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},nF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},sF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},_F=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},oF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},pF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},aF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},uF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},rF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},lF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},dF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},IF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},TF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},MF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},hF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},mF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},EF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Ix=function(){return"control.reset()\n"},Tx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},Mx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},hx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},mx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Ex=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},Ox=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Rx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},cx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},gx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Cx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Sx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Ax=function(){return"while True:\n pass\n"},Lx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},Nx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Dx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},fx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Fx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Px=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},vx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},Yx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},Xx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},xx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},yx=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},bx=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Vx=Yx,Bx=Px,Gx=vx,Ux=Dx,wx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},kx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Hx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},Kx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Zx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},$x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ty=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ny={};ny["MixGo CC"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-31"]),exlcdv:Et.Profile.generate(["0-11"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["MixGo ME"]={description:"MicroPython[ESP32C3 MixGo ME]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-7"]),exlcdv:Et.Profile.generate(["0-4"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["MixGo Car 4.2"]={description:"MicroPython[ESP32]",digital_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["20","20"],["21","21"]],digital:[["pin0","pin0"],["pin1","pin1"],["pin2","pin2"],["pin3","pin3"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin20","pin20"],["pin21","pin21"]],pwm_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["20","20"],["21","21"]],pwm:[["pwm0","pwm0"],["pwm1","pwm1"],["pwm2","pwm2"],["pwm3","pwm3"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm6","pwm6"],["pwm7","pwm7"],["pwm8","pwm8"],["pwm9","pwm9"],["pwm10","pwm10"],["pwm20","pwm20"],["pwm21","pwm21"]],espnow_channel:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"]],i2c_A_pin:[["6","6"],["9","9"]],i2c_B_pin:[["7","7"],["10","10"]],spi_A_pin:[["6","6"],["9","9"]],spi_B_pin:[["7","7"],["10","10"]],spi_C_pin:[["9","9"],["20","20"]],spi_D_pin:[["10","10"],["21","21"]],analog_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],analog:[["adc0","adc0"],["adc1","adc1"],["adc2","adc2"],["adc3","adc3"],["adc4","adc4"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],buttonB:[["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["24","24"],["25","25"],["26","26"],["27","27"],["28","28"],["29","29"],["30","30"],["31","31"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","matrix.Image.HEART"],["HEART_SMALL","matrix.Image.HEART_SMALL"],["HAPPY","matrix.Image.HAPPY"],["SAD","matrix.Image.SAD"],["SMILE","matrix.Image.SMILE"],["SILLY","matrix.Image.SILLY"],["FABULOUS","matrix.Image.FABULOUS"],["SURPRISED","matrix.Image.SURPRISED"],["ASLEEP","matrix.Image.ASLEEP"],["ANGRY","matrix.Image.ANGRY"],["CONFUSED","matrix.Image.CONFUSED"],["NO","matrix.Image.NO"],["YES","matrix.Image.YES"],["LEFT_ARROW","matrix.Image.LEFT_ARROW"],["RIGHT_ARROW","matrix.Image.RIGHT_ARROW"],["DRESS","matrix.Image.DRESS"],["TRANSFORMERS","matrix.Image.TRANSFORMERS"],["SCISSORS","matrix.Image.SCISSORS"],["EXIT","matrix.Image.EXIT"],["TREE","matrix.Image.TREE"],["PACMAN","matrix.Image.PACMAN"],["TARGET","matrix.Image.TARGET"],["TSHIRT","matrix.Image.TSHIRT"],["ROLLERSKATE","matrix.Image.ROLLERSKATE"],["DUCK","matrix.Image.DUCK"],["HOUSE","matrix.Image.HOUSE"],["TORTOISE","matrix.Image.TORTOISE"],["BUTTERFLY","matrix.Image.BUTTERFLY"],["STICKFIGURE","matrix.Image.STICKFIGURE"],["GHOST","matrix.Image.GHOST"],["PITCHFORK","matrix.Image.PITCHFORK"],["MUSIC_QUAVERS","matrix.Image.MUSIC_QUAVERS"],["MUSIC_QUAVER","matrix.Image.MUSIC_QUAVER"],["MUSIC_CROTCHET","matrix.Image.MUSIC_CROTCHET"],["COW","matrix.Image.COW"],["RABBIT","matrix.Image.RABBIT"],["SQUARE_SMALL","matrix.Image.SQUARE_SMALL"],["SQUARE","matrix.Image.SQUARE"],["DIAMOND_SMALL","matrix.Image.DIAMOND_SMALL"],["DIAMOND","matrix.Image.DIAMOND"],["CHESSBOARD","matrix.Image.CHESSBOARD"],["TRIANGLE_LEFT","matrix.Image.TRIANGLE_LEFT"],["TRIANGLE","matrix.Image.TRIANGLE"],["SNAKE","matrix.Image.SNAKE"],["UMBRELLA","matrix.Image.UMBRELLA"],["SKULL","matrix.Image.SKULL"],["GIRAFFE","matrix.Image.GIRAFFE"],["SWORD","matrix.Image.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","music.DADADADUM"],["ENTERTAINER","music.ENTERTAINER"],["PRELUDE","music.PRELUDE"],["ODE","music.ODE"],["NYAN","music.NYAN"],["RINGTONE","music.RINGTONE"],["FUNK","music.FUNK"],["BLUES","music.BLUES"],["BIRTHDAY","music.BIRTHDAY"],["WEDDING","music.WEDDING"],["FUNERAL","music.FUNERAL"],["PUNCHLINE","music.PUNCHLINE"],["PYTHON","music.PYTHON"],["BADDY","music.BADDY"],["CHASE","music.CHASE"],["BA_DING","music.BA_DING"],["WAWAWAWAA","music.WAWAWAWAA"],["JUMP_UP","music.JUMP_UP"],["JUMP_DOWN","music.JUMP_DOWN"],["POWER_UP","music.POWER_UP"],["POWER_DOWN","music.POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["ESP32C3 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-31"]),exlcdv:Et.Profile.generate(["0-11"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const sy=ny,_y=20,oy={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_HIGH,"HIGH"],[mt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},py={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},ay={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},uy={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},ry={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_mSecond,"period"],[mt.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},ly={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_REF_VOLTAGE+mt.Msg.MIXLY_STAT).appendField(new mt.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},dy={init:function(){this.setColour(_y),this.appendValueInput("pin").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},Iy={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Ty={init:function(){this.setColour(20),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_AS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[mt.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[mt.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[mt.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},My={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("dac#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},hy={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("tc#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},my={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField("PWM"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_FREQUENCY+mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},Ey=Ty,Oy=hy,Ry=dy,cy=Iy,gy=40,Cy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput("").appendField(t).appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[t]}))}},Sy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput("").appendField(t).appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ay={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ly={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ny={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,Number),this.setInputsInline(!0)}},Dy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0)}},Fy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Py=230,vy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital),"PIN"),this.setOutput(!0)}},Yy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},Xy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},xy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},yy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},by={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},Vy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},By={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Gy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Uy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},wy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},ky={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Hy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Wy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ky={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Jy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},Qy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog),"PIN"),this.setOutput(!0)}},qy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},zy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac),"PIN"),this.setOutput(!0)}},jy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Zy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm),"PIN"),this.setOutput(!0)}},eb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},nb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch),"PIN"),this.setOutput(!0)}},sb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},_b={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},ob={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},pb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.imglist),"PIN"),this.setOutput(!0)}},ab={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist),"PIN"),this.setOutput(!0)}},ub={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},rb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},db={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Tb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},hb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Eb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.one_more),"PIN"),this.setOutput(!0)}},cb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},gb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},Cb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},Sb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Ab=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},Lb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},Nb=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},Db=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},fb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},Fb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},Pb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},vb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},Yb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_ahtx0."+i+"()",e.ORDER_ATOMIC]},Xb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_hp203x."+i,e.ORDER_ATOMIC]},xb=function(t,e){e.definitions_.import_me_g1="import me_g1";return["me_g1.varistor()",e.ORDER_ATOMIC]},yb=function(t,e){e.definitions_.import_me_g1="import me_g1";return['me_g1.ext_rc522.read_card(0, x="id")',e.ORDER_ATOMIC]},bb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.read_card("+i+")",e.ORDER_ATOMIC]},Vb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),n=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1","me_g1.ext_rc522.write_card("+n+","+i+")\n"},Bb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),n=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.write_card("+n+","+i+")",e.ORDER_ATOMIC]},Gb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.scan_card()=="+i,e.ORDER_ATOMIC]},Ub=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},wb=Ub,kb=Ub,Hb=Ub,Wb=Ub,Kb=Ub,Jb=Ub,Qb=Ub,qb=Ub,zb=Ub,jb=Ub,Zb=Ub,$b=Ub,tV=Ub,eV=Ub,iV=Ub,nV=Ub,sV=Ub,_V=Ub,oV=Ub,pV=Ub,aV=Ub,uV=Ub,rV=Ub,lV=Ub,dV=Ub,IV=Ub,TV=Ub,MV=Ub,hV=Ub,mV=Ub,EV=Ub,OV=Ub,RV=Ub,cV=Ub,gV=Ub,CV=Ub,SV=Ub,AV=Ub,LV=Ub,NV=Ub,DV=Ub,fV=Ub,FV=Ub,PV=Ub;Object.assign(mt.Variables,Rt),Object.assign(mt.Procedures,$n),mt.Python=cu,mt.generator=cu,Et.Profile.default={},Object.assign(Et.Profile,sy),Object.assign(Et.Profile.default,sy["MixGo CC"]),Object.assign(mt.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,V,H,k,X,B,W,f,w,U,G,F,D,N,y,x,b,P,v,Y,lt,dt,It),Object.assign(mt.Python.forBlock,T,M,h,m,E,O,R,c,g,C,S,A,L,nt,ut,at,$,st,rt,Q,pt,ot,_t,q,J,K,et,tt,it,z,j,Z,Tt,Mt,ht)})(); \ No newline at end of file +class ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Gt={init:function(){this.setColour(Xt),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ut={init:function(){this.setColour(Xt),this.appendValueInput("LIST").setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(mt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wt={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new mt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(mt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ht={init:function(){this.setColour(Xt);var t=new mt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Wt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};wt.OPERATORS=[[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Ht.OPERATORS=[[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},$t={init:function(){this.jsonInit({message0:mt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Xt,tooltip:mt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:mt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},te={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_STAT),this.setOutput(!0)}},ee={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},ie={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ne={init:function(){this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(mt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new mt.FieldDropdown([[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Xt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},se={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_e={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},oe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},pe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ae={init:function(){this.setColour(Xt),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(mt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ue=230;mt.FieldTextInput.math_number_validator=function(t){return String(t)},mt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const re={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},le={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},de={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ie={init:function(){this.setColour(ue),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Te={init:function(){this.setColour(ue),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Me={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new mt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},he={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:mt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:mt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:mt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:mt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:mt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:mt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:mt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},me={init:function(){var t=[[mt.Msg.MATH_BIN,"bin"],[mt.Msg.MATH_OCT,"oct"],[mt.Msg.MATH_HEX,"hex"]];this.setColour(ue),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:mt.Msg.MATH_DEC_TOOLTIP_BIN,oct:mt.Msg.MATH_DEC_TOOLTIP_OCT,hex:mt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ee={init:function(){var t=[[mt.Msg.LANG_MATH_TO_ROUND,"round"],[mt.Msg.LANG_MATH_TO_CEIL,"ceil"],[mt.Msg.LANG_MATH_TO_FLOOR,"floor"],[mt.Msg.MATH_ABS,"fabs"],[mt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:mt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:mt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:mt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:mt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:mt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:mt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Oe={init:function(){var t=[[mt.Msg.MIXLY_MAX,"max"],[mt.Msg.MIXLY_MIN,"min"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(mt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:mt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:mt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Re={init:function(){var t=[[mt.Msg.MATH_TWO,"two"],[mt.Msg.MATH_EIGHT,"eight"],[mt.Msg.MATH_TEN,"ten"],[mt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ue),this.appendDummyInput("").appendField(mt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new mt.FieldDropdown(t),"OP").appendField(mt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MATH_ZHW).appendField(new mt.FieldDropdown(t),"OP2").appendField(mt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:mt.Msg.MATH_Before_two,eight:mt.Msg.MATH_Before_eight,ten:mt.Msg.MATH_Before_ten,sixteen:mt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:mt.Msg.MATH_Behind_two,eight:mt.Msg.MATH_Behind_eight,ten:mt.Msg.MATH_Behind_ten,sixteen:mt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},ce={init:function(){var t=[[mt.Msg.LANG_MATH_INT,"int"],[mt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ue),this.setOutput(!0,Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new mt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:mt.Msg.LANG_MATH_INT,float:mt.Msg.LANG_MATH_FLOAT_RANDOM};return mt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ce={init:function(){this.setColour(ue),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(mt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(mt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Se={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},Ae={init:function(){this.setColour(ue),this.appendValueInput("NUM").setCheck(Number).appendField(mt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Le={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MATH_ROUND).appendField(mt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(mt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ne={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"],[mt.Msg.MIXLY_TO_BITES,"b"],[mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:mt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},De={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:mt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},fe=Ce,Fe={init:function(){this.setColour(ue),this.appendValueInput("VAR").appendField(mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Pe={init:function(){this.setColour(ue),this.itemCount_=1,this.setMutator(new mt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(mt.Msg.MIXLY_PRODUCT+mt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(mt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(mt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const xe={init:function(){this.setColour(ve),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new mt.FieldTextInput("",mt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(mt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new mt.FieldImage(e,7,12,'"')}},ye={init:function(){this.setColour(ve),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(mt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},be={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ve={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String).appendField(mt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Be={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ge={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ue={init:function(){this.WHERE_OPTIONS=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.TEXT_GET_INDEX_RANDOM+1+mt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.LISTS_GET_INDEX_GET,"MODE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(mt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+mt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",mt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:mt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:mt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:mt.Msg.TEXT_GET_INDEX_RANDOM};return mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+mt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==mt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new mt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},we={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.LISTS_GET_INDEX_FROM_START+"n"+mt.Msg.TEXT_CHARAT2)}},ke={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(mt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(mt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},He={init:function(){this.WHERE_OPTIONS_1=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[mt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==mt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new mt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},We={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(mt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ke={init:function(){var t=[[mt.Msg.MIXLY_EQUALS,"==="],[mt.Msg.MIXLY_STARTSWITH,"startswith"],[mt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new mt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Je={init:function(){this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_COMPARETO_HELP)}},Qe={init:function(){var t=[[mt.Msg.TEXT_UPPER,"upper"],[mt.Msg.TEXT_TITLE,"title"],[mt.Msg.TEXT_CAPITALIZE,"capitalize"],[mt.Msg.TEXT_SWAPCASE,"swapcase"],[mt.Msg.TEXT_LOWER,"lower"]];this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:mt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:mt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:mt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:mt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:mt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},qe={init:function(){var t=[[mt.Msg.TEXT_LJUST,"ljust"],[mt.Msg.TEXT_CENTER,"center"],[mt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ve),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(mt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(mt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(mt.Msg.MIXLY_MID+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(mt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},je={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(mt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},$e={init:function(){this.setColour(ve),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(mt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(mt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ti={init:function(){var t=[[mt.Msg.TEXT_TRIM_BOTH,"strip"],[mt.Msg.TEXT_TRIM_LEFT,"lstrip"],[mt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ve),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(mt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:mt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:mt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:mt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ei={init:function(){this.setColour(ve),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new mt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zi={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ji={init:function(){this.setColour(Qi),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zi={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_KEYS),this.setTooltip(mt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_TOOLTIP)}},tn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},en={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},nn={init:function(){this.setColour(Qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_DELETE_TOOLTIP)}},sn={init:function(){this.setColour(Qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(mt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(mt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MID),this.setTooltip(mt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_n={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_CLEAR),this.setTooltip(mt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},on={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_ITEMS),this.setTooltip(mt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},pn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_VALUES),this.setTooltip(mt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},an={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LENGTH),this.setTooltip(mt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},un={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_DELDICT),this.setTooltip(mt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rn={init:function(){this.MODE=[[mt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[mt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(mt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=mt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=mt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new mt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},ln={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setTooltip(mt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},In={init:function(){this.setColour(Qi),this.appendDummyInput("").appendField(new mt.FieldLabel(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new mt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Tn={init:function(){this.setColour(Qi),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TO_JSON),this.setTooltip(mt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},hn={init:function(){this.setColour(Qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},mn={init:function(){this.setColour(Qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En=210,On={init:function(){var t=mt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:mt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:mt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Rn={init:function(){var t=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new mt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},cn={init:function(){var t=[[mt.Msg.LOGIC_OPERATION_AND,"AND"],[mt.Msg.LOGIC_OPERATION_OR,"OR"],[mt.Msg.LOGIC_OPERATION_NOR,"NOR"],[mt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:mt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:mt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(mt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(mt.Msg.LOGIC_NEGATE_TOOLTIP)}},Cn={init:function(){var t=[[mt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[mt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new mt.FieldDropdown(t),"BOOL"),this.setTooltip(mt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Sn={init:function(){this.setColour(En),this.setOutput(!0),this.appendDummyInput().appendField(mt.Msg.LOGIC_NULL),this.setTooltip(mt.Msg.LOGIC_NULL_TOOLTIP)}},An={init:function(){this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(mt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(mt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Ln={init:function(){var t=[[mt.Msg.TEXT_APPEND_TO,"in"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new mt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(mt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.IN)}},Nn={init:function(){var t=[[mt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Dn={init:function(){this.setColour(En),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},fn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(mt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXPY_TEXT_ENCODE).appendField(new mt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MICROBIT_PYTHON_TYPE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.HTML_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Gn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Kn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+mt.Msg.MIXLY_ESP32_SET+{mkdir:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(mt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.HTML_FILE,"isfile"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(mt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(mt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Zn={};Zn.NAME_TYPE=mt.PROCEDURE_CATEGORY_NAME,Zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_FORM_CONTENT).appendField(new mt.FieldDropdown([[mt.Msg.HTML_TEXT,"text"],[mt.Msg.HTML_EMAIL,"email"],[mt.Msg.HTML_NUMBER,"number"],[mt.Msg.HTML_PASSWORD,"password"],[mt.Msg.HTML_CHECKBOX,"checkbox"],[mt.Msg.HTML_RADIOBUTTON,"radiobutton"],[mt.Msg.HTML_BUTTON,"button"],[mt.Msg.HTML_COLOUR,"colour"],[mt.Msg.HTML_DATE,"date"],[mt.Msg.HTML_LOCALTIME,"local time"],[mt.Msg.HTML_FILE,"file"],[mt.Msg.HTML_HIDDEN,"hidden"],[mt.Msg.HTML_IMAGE,"image"],[mt.Msg.HTML_MONTH,"month"],[mt.Msg.HTML_RANGE,"range"],[mt.Msg.HTML_RESET,"reset"],[mt.Msg.HTML_SEARCH,"search"],[mt.Msg.HTML_SUBMIT,"submit"],[mt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[mt.Msg.HTML_TIME,"time"],[mt.Msg.HTML_URL,"url"],[mt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(mt.Msg.HTML_NAME).appendField(new mt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(mt.Msg.HTML_VALUE).appendField(new mt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_TEXT).appendField(new mt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs=160,$s={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new mt.FieldTable(""),"TEXT")}},t_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT")}},e_={init:function(){this.setColour(Zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},i_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},n_={init:function(){this.setColour(Zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new mt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},s_={init:function(){this.setColour(Zs),this.appendValueInput("VALUE").appendField(mt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},__={init:function(){this.setColour(Zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(mt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=mt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},mt.isNumber(n)&&mt.isNumber(s)&&mt.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const qp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},jp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Zp=function(t,e){return["None",e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ta=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ia=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},na=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},sa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},_a=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},oa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},pa=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},aa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ua=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ma=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ea=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Sa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},La=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),mt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ru=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lu=function(t,e){return'"},du=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Iu=function(){return this.getFieldValue("TEXT")+"\n"},Tu=function(t){return t.getFieldValue("TEXT")+"\n"},Mu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},hu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},mu=function(){return""},Eu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ou=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},cu.scrubNakedValue=function(t){return t+"\n"},cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=mt.utils.string.wrap(_,cu.COMMENT_WRAP-3),n+=cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const gu="#74A55B",Cu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Su={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Au={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Lu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Nu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Du={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},vu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Yu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Xu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},xu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},bu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField("360°"+mt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SETTING+mt.Msg.blockpy_turtle_rotate+mt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Vu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Gu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Uu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},wu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new mt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(mt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},ku={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[mt.Msg.MOTOR_N,"ms32006.MOT_N"],[mt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Hu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new mt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Wu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Ku={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Ju={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new mt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+mt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ju={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},$u={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},tr={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},er={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},nr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LISTS_SET_INDEX_SET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},_r={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},or={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[mt.Msg.MIXLY_SPEED,"[1]"],[mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[mt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[mt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[mt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ar={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Mr="#6C9858",hr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},mr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_ON,"1"],[mt.Msg.MIXLY_ESP32_OFF,"0"],[mt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Er={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Or={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},cr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},gr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LCD_SETCOLOR).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LIGHT_RED,"1"],[mt.Msg.MIXLY_LIGHT_GREEN,"2"],[mt.Msg.MIXLY_LIGHT_BLUE,"3"],[mt.Msg.MIXLY_LIGHT_YELLOW,"4"],[mt.Msg.MIXLY_LIGHT_CYAN,"5"],[mt.Msg.MIXLY_LIGHT_PURPLE,"6"],[mt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Sr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ar={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Lr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Nr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Dr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},fr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Fr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Pr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},vr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Yr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Xr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},xr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},yr={init:function(){this.setColour(Mr),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},br={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Vr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Br={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Gr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ur={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wr={init:function(){this.setColour(Mr),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},kr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Kr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},qr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},jr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"1"],[mt.Msg.TEXT_TRIM_RIGHT,"2"],[mt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},el={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"0"],[mt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(Mr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(Mr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_RECORD_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},al={init:function(){this.setColour(Mr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},rl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ll={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},dl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Il={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.MIXLY_ALL+mt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(mt.ALIGN_RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Tl={init:function(){this.setColour(Mr),this.appendDummyInput().appendField(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(mt.Msg.MIXLY_RELEASE).appendField(new mt.FieldDropdown([[mt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[mt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT)}},Ml={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SPECIAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[mt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[mt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[mt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[mt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[mt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[mt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},hl={init:function(){this.setColour(Mr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GENERAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ml={init:function(){this.setColour(Mr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new mt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(mt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(mt.Msg.MIXLY_WIFI_USERNAME).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(mt.Msg.MIXLY_IOT_PASSWORD).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_PROJECT).setAlign(mt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(mt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},$m={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_SUBSCRIBE+mt.Msg.MIXLY_MICROBIT_MSG).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(mt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},tE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},sE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},_E={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},oE={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},pE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},aE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(mt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},uE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+mt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lE={init:function(){this.VISITOR_ID=Et.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Um),this.appendDummyInput("").appendField(new mt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},dE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},IE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(mt.Msg.MIXLY_REQUESTS_GET).appendField(mt.Msg.MIXLY_GET_CURRENT_TIME).appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},ME={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(mt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(mt.Msg.MQTT_Topic).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mE=wm,EE=km,OE=Hm,RE=Wm,cE=Jm,gE=225,CE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(mt.Msg.MIXLY_NETWORK_MODE).appendField(new mt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},SE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[mt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=mt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:mt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:mt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},AE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},LE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:mt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},NE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(mt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(mt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},DE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_CONNECT+mt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},fE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[mt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:mt.Msg.MIXLY_ESP32_NETWORK_IP,1:mt.Msg.MIXLY_ESP32_NETWORK_MASK,2:mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},FE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},PE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},vE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(mt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},YE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},XE={init:function(){this.setColour(gE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new mt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},xE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},yE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},bE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},VE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},BE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},GE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},UE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},wE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},kE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},HE={init:function(){this.setColour(gE),this.appendValueInput("DOMAIN").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS_GET).appendField(new mt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},WE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:mt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:mt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:mt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},KE={init:function(){this.appendValueInput("VAR").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:mt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:mt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},JE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(mt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(new mt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},qE="#3288dd",zE={init:function(){this.setColour(qE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS).appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},jE={init:function(){this.setColour(qE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(mt.Msg.blockpy_REQUESTS+mt.Msg.OLED_STRING),this.appendDummyInput("").appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},ZE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[mt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(qE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},$E="#A58C5B",tO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_IS_PRESSED)}},eO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_WAS_PRESSED)}},iO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_BUTTON+mt.Msg.MIXLY_GET_PRESSES)}},nO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},sO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"],[mt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down,freefall:mt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},_O={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},oO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},pO={init:function(){var t=[[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour($E),this.appendValueInput("PIN",Number).appendField(new mt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},aO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},uO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},rO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"left"],[mt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(mt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=mt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=mt.Msg.MIXLY_ESP32_NEAR;return i+{left:mt.Msg.TEXT_TRIM_LEFT,right:mt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},lO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[mt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},dO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[mt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},IO={init:function(){this.setColour($E),this.appendValueInput("PIN",Number).appendField("DS18X20 "+mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},TO={init:function(){this.setColour($E),this.appendDummyInput("").appendField("LM35"+mt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LM35)}},MO={init:function(){this.setColour($E),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},hO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[mt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[mt.Msg.MIXLY_ESP32_MAX30102_IR+","+mt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},mO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[mt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[mt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},OO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+mt.Msg.HTML_COLOUR,"[2]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_IR_STRENGTH,"[1]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},RO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+"RGB"+mt.Msg.HTML_COLOUR,"0"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_RGB_RAW,"1"],[mt.Msg.MIXLY_GET_ENV_LIGHT+mt.Msg.MIXLY_BRIGHTNESS,"2"],[mt.Msg.GET_IR_STRENGTH+mt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},cO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[mt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},gO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},CO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},SO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},AO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},NO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MIXGOPE_FIELD+mt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[mt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},fO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},FO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET+mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},PO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+mt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},vO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},YO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_GETTEMPERATUE)}},XO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},xO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},yO={init:function(){this.setColour($E),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},bO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[mt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},VO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},BO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},GO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},UO={init:function(){this.setColour($E),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},wO={init:function(){this.setColour($E),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},kO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},HO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},WO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},KO={init:function(){this.setColour($E),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},$N=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},tD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},eD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},nD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},_D=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},oD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},pD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},aD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},uD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},rD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},lD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},dD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ID=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},TD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},MD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},hD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},mD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},ED=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},OD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},RD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},gD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},CD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},SD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},AD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},LD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},ND=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},DD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},fD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},FD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},PD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},vD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Et.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},YD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},XD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},xD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},yD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},bD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},VD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},BD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},GD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},UD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},wD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},kD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},HD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},WD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Et.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},KD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},JD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},QD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},qD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},zD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ZD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},tf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},nf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},sf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},_f=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},of=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},pf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},af=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},rf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},lf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},df=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},If=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},Tf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Mf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},hf=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Qf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},qf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},zf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},jf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Zf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},$f=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},tF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},eF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},iF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},nF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},sF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},_F=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},oF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},pF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},aF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},uF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},rF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},lF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},dF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},IF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},TF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},MF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},hF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},mF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},EF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Ix=function(){return"control.reset()\n"},Tx=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},Mx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},hx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},mx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},Ex=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},Ox=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Rx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},cx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},gx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Cx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Sx=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},Ax=function(){return"while True:\n pass\n"},Lx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},Nx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Dx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},fx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Fx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Px=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},vx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},Yx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},Xx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},xx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},yx=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},bx=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Vx=Yx,Bx=Px,Gx=vx,Ux=Dx,wx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},kx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Hx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},Kx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},qx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},zx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Zx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},$x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ty=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ny={};ny["MixGo CC"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-31"]),exlcdv:Et.Profile.generate(["0-11"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["MixGo ME"]={description:"MicroPython[ESP32C3 MixGo ME]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-7"]),exlcdv:Et.Profile.generate(["0-4"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["MixGo Car 4.2"]={description:"MicroPython[ESP32]",digital_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["20","20"],["21","21"]],digital:[["pin0","pin0"],["pin1","pin1"],["pin2","pin2"],["pin3","pin3"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin20","pin20"],["pin21","pin21"]],pwm_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["20","20"],["21","21"]],pwm:[["pwm0","pwm0"],["pwm1","pwm1"],["pwm2","pwm2"],["pwm3","pwm3"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm6","pwm6"],["pwm7","pwm7"],["pwm8","pwm8"],["pwm9","pwm9"],["pwm10","pwm10"],["pwm20","pwm20"],["pwm21","pwm21"]],espnow_channel:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"]],i2c_A_pin:[["6","6"],["9","9"]],i2c_B_pin:[["7","7"],["10","10"]],spi_A_pin:[["6","6"],["9","9"]],spi_B_pin:[["7","7"],["10","10"]],spi_C_pin:[["9","9"],["20","20"]],spi_D_pin:[["10","10"],["21","21"]],analog_pin:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],analog:[["adc0","adc0"],["adc1","adc1"],["adc2","adc2"],["adc3","adc3"],["adc4","adc4"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],buttonB:[["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["24","24"],["25","25"],["26","26"],["27","27"],["28","28"],["29","29"],["30","30"],["31","31"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","matrix.Image.HEART"],["HEART_SMALL","matrix.Image.HEART_SMALL"],["HAPPY","matrix.Image.HAPPY"],["SAD","matrix.Image.SAD"],["SMILE","matrix.Image.SMILE"],["SILLY","matrix.Image.SILLY"],["FABULOUS","matrix.Image.FABULOUS"],["SURPRISED","matrix.Image.SURPRISED"],["ASLEEP","matrix.Image.ASLEEP"],["ANGRY","matrix.Image.ANGRY"],["CONFUSED","matrix.Image.CONFUSED"],["NO","matrix.Image.NO"],["YES","matrix.Image.YES"],["LEFT_ARROW","matrix.Image.LEFT_ARROW"],["RIGHT_ARROW","matrix.Image.RIGHT_ARROW"],["DRESS","matrix.Image.DRESS"],["TRANSFORMERS","matrix.Image.TRANSFORMERS"],["SCISSORS","matrix.Image.SCISSORS"],["EXIT","matrix.Image.EXIT"],["TREE","matrix.Image.TREE"],["PACMAN","matrix.Image.PACMAN"],["TARGET","matrix.Image.TARGET"],["TSHIRT","matrix.Image.TSHIRT"],["ROLLERSKATE","matrix.Image.ROLLERSKATE"],["DUCK","matrix.Image.DUCK"],["HOUSE","matrix.Image.HOUSE"],["TORTOISE","matrix.Image.TORTOISE"],["BUTTERFLY","matrix.Image.BUTTERFLY"],["STICKFIGURE","matrix.Image.STICKFIGURE"],["GHOST","matrix.Image.GHOST"],["PITCHFORK","matrix.Image.PITCHFORK"],["MUSIC_QUAVERS","matrix.Image.MUSIC_QUAVERS"],["MUSIC_QUAVER","matrix.Image.MUSIC_QUAVER"],["MUSIC_CROTCHET","matrix.Image.MUSIC_CROTCHET"],["COW","matrix.Image.COW"],["RABBIT","matrix.Image.RABBIT"],["SQUARE_SMALL","matrix.Image.SQUARE_SMALL"],["SQUARE","matrix.Image.SQUARE"],["DIAMOND_SMALL","matrix.Image.DIAMOND_SMALL"],["DIAMOND","matrix.Image.DIAMOND"],["CHESSBOARD","matrix.Image.CHESSBOARD"],["TRIANGLE_LEFT","matrix.Image.TRIANGLE_LEFT"],["TRIANGLE","matrix.Image.TRIANGLE"],["SNAKE","matrix.Image.SNAKE"],["UMBRELLA","matrix.Image.UMBRELLA"],["SKULL","matrix.Image.SKULL"],["GIRAFFE","matrix.Image.GIRAFFE"],["SWORD","matrix.Image.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","music.DADADADUM"],["ENTERTAINER","music.ENTERTAINER"],["PRELUDE","music.PRELUDE"],["ODE","music.ODE"],["NYAN","music.NYAN"],["RINGTONE","music.RINGTONE"],["FUNK","music.FUNK"],["BLUES","music.BLUES"],["BIRTHDAY","music.BIRTHDAY"],["WEDDING","music.WEDDING"],["FUNERAL","music.FUNERAL"],["PUNCHLINE","music.PUNCHLINE"],["PYTHON","music.PYTHON"],["BADDY","music.BADDY"],["CHASE","music.CHASE"],["BA_DING","music.BA_DING"],["WAWAWAWAA","music.WAWAWAWAA"],["JUMP_UP","music.JUMP_UP"],["JUMP_DOWN","music.JUMP_DOWN"],["POWER_UP","music.POWER_UP"],["POWER_DOWN","music.POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},ny["ESP32C3 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-11","18-21"]),input_pin:Et.Profile.generate(["0-11","18-21"]),output_pin:Et.Profile.generate(["0-11","18-21"]),pwm_input:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-5"],"adc","adc"),pwm_output:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-5"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-11","18-21"]),pwm:Et.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:Et.Profile.generate(["0-5"]),analog:Et.Profile.generate(["0-5"],"adc","adc"),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-31"]),exlcdv:Et.Profile.generate(["0-11"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const sy=ny,_y=20,oy={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_HIGH,"HIGH"],[mt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},py={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},ay={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},uy={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},ry={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_mSecond,"period"],[mt.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},ly={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_REF_VOLTAGE+mt.Msg.MIXLY_STAT).appendField(new mt.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},dy={init:function(){this.setColour(_y),this.appendValueInput("pin").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},Iy={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Ty={init:function(){this.setColour(20),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_AS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[mt.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[mt.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[mt.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},My={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("dac#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},hy={init:function(){this.setColour(_y),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("tc#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},my={init:function(){this.setColour(_y),this.appendValueInput("PIN",Number).appendField("PWM"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_FREQUENCY+mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},Ey=Ty,Oy=hy,Ry=dy,cy=Iy,gy=40,Cy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput("").appendField(t).appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[t]}))}},Sy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput("").appendField(t).appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ay={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ly={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ny={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,Number),this.setInputsInline(!0)}},Dy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0)}},Fy={init:function(){if("mixgo_me"==Et.Boards.getSelectedBoardKey().split(":")[2])var t="ME G1";this.setColour(gy),this.appendDummyInput().appendField(t).appendField("RFID"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Py=230,vy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital),"PIN"),this.setOutput(!0)}},Yy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},Xy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},xy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},yy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},by={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},Vy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},By={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Gy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Uy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},wy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},ky={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Hy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Wy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ky={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Jy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},Qy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog),"PIN"),this.setOutput(!0)}},qy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},zy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac),"PIN"),this.setOutput(!0)}},jy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Zy={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm),"PIN"),this.setOutput(!0)}},eb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},nb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch),"PIN"),this.setOutput(!0)}},sb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},_b={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},ob={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},pb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.imglist),"PIN"),this.setOutput(!0)}},ab={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist),"PIN"),this.setOutput(!0)}},ub={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},rb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},db={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Tb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},hb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Eb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.one_more),"PIN"),this.setOutput(!0)}},cb={init:function(){this.setColour(Py),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},gb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},Cb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},Sb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Ab=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},Lb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},Nb=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},Db=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},fb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},Fb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},Pb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},vb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},Yb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_ahtx0."+i+"()",e.ORDER_ATOMIC]},Xb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_hp203x."+i,e.ORDER_ATOMIC]},xb=function(t,e){e.definitions_.import_me_g1="import me_g1";return["me_g1.varistor()",e.ORDER_ATOMIC]},yb=function(t,e){e.definitions_.import_me_g1="import me_g1";return['me_g1.ext_rc522.read_card(0, x="id")',e.ORDER_ATOMIC]},bb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.read_card("+i+")",e.ORDER_ATOMIC]},Vb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),n=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1","me_g1.ext_rc522.write_card("+n+","+i+")\n"},Bb=function(t,e){var i=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),n=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.write_card("+n+","+i+")",e.ORDER_ATOMIC]},Gb=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_me_g1="import me_g1",["me_g1.ext_rc522.scan_card()=="+i,e.ORDER_ATOMIC]},Ub=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},wb=Ub,kb=Ub,Hb=Ub,Wb=Ub,Kb=Ub,Jb=Ub,Qb=Ub,qb=Ub,zb=Ub,jb=Ub,Zb=Ub,$b=Ub,tV=Ub,eV=Ub,iV=Ub,nV=Ub,sV=Ub,_V=Ub,oV=Ub,pV=Ub,aV=Ub,uV=Ub,rV=Ub,lV=Ub,dV=Ub,IV=Ub,TV=Ub,MV=Ub,hV=Ub,mV=Ub,EV=Ub,OV=Ub,RV=Ub,cV=Ub,gV=Ub,CV=Ub,SV=Ub,AV=Ub,LV=Ub,NV=Ub,DV=Ub,fV=Ub,FV=Ub,PV=Ub;Object.assign(mt.Variables,Rt),Object.assign(mt.Procedures,$n),mt.Python=cu,mt.generator=cu,Et.Profile.default={},Object.assign(Et.Profile,sy),Object.assign(Et.Profile.default,sy["MixGo CC"]),Object.assign(mt.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,V,H,k,X,B,W,f,w,U,G,F,D,N,y,x,b,P,v,Y,lt,dt,It),Object.assign(mt.Python.forBlock,T,M,h,m,E,O,R,c,g,C,S,A,L,nt,ut,at,$,st,rt,Q,pt,ot,_t,q,J,K,et,tt,it,z,j,Z,Tt,Mt,ht)})(); \ No newline at end of file diff --git a/boards/default/micropython_esp32s2/main.bundle.js b/boards/default/micropython_esp32s2/main.bundle.js index fafbc882..f664ff7e 100644 --- a/boards/default/micropython_esp32s2/main.bundle.js +++ b/boards/default/micropython_esp32s2/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Gt={init:function(){this.setColour(Xt),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ut={init:function(){this.setColour(Xt),this.appendValueInput("LIST").setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(mt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wt={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new mt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(mt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ht={init:function(){this.setColour(Xt);var t=new mt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Wt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};wt.OPERATORS=[[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Ht.OPERATORS=[[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},$t={init:function(){this.jsonInit({message0:mt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Xt,tooltip:mt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:mt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},te={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_STAT),this.setOutput(!0)}},ee={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},ie={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ne={init:function(){this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(mt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new mt.FieldDropdown([[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Xt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},se={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_e={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},oe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},pe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ae={init:function(){this.setColour(Xt),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(mt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ue=230;mt.FieldTextInput.math_number_validator=function(t){return String(t)},mt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const re={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},le={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},de={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ie={init:function(){this.setColour(ue),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Te={init:function(){this.setColour(ue),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},he={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new mt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Me={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:mt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:mt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:mt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:mt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:mt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:mt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:mt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},me={init:function(){var t=[[mt.Msg.MATH_BIN,"bin"],[mt.Msg.MATH_OCT,"oct"],[mt.Msg.MATH_HEX,"hex"]];this.setColour(ue),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:mt.Msg.MATH_DEC_TOOLTIP_BIN,oct:mt.Msg.MATH_DEC_TOOLTIP_OCT,hex:mt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ee={init:function(){var t=[[mt.Msg.LANG_MATH_TO_ROUND,"round"],[mt.Msg.LANG_MATH_TO_CEIL,"ceil"],[mt.Msg.LANG_MATH_TO_FLOOR,"floor"],[mt.Msg.MATH_ABS,"fabs"],[mt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:mt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:mt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:mt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:mt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:mt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:mt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Oe={init:function(){var t=[[mt.Msg.MIXLY_MAX,"max"],[mt.Msg.MIXLY_MIN,"min"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(mt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:mt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:mt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Re={init:function(){var t=[[mt.Msg.MATH_TWO,"two"],[mt.Msg.MATH_EIGHT,"eight"],[mt.Msg.MATH_TEN,"ten"],[mt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ue),this.appendDummyInput("").appendField(mt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new mt.FieldDropdown(t),"OP").appendField(mt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MATH_ZHW).appendField(new mt.FieldDropdown(t),"OP2").appendField(mt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:mt.Msg.MATH_Before_two,eight:mt.Msg.MATH_Before_eight,ten:mt.Msg.MATH_Before_ten,sixteen:mt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:mt.Msg.MATH_Behind_two,eight:mt.Msg.MATH_Behind_eight,ten:mt.Msg.MATH_Behind_ten,sixteen:mt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},ce={init:function(){var t=[[mt.Msg.LANG_MATH_INT,"int"],[mt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ue),this.setOutput(!0,Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new mt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:mt.Msg.LANG_MATH_INT,float:mt.Msg.LANG_MATH_FLOAT_RANDOM};return mt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ce={init:function(){this.setColour(ue),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(mt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(mt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Se={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},Ae={init:function(){this.setColour(ue),this.appendValueInput("NUM").setCheck(Number).appendField(mt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Le={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MATH_ROUND).appendField(mt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(mt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ne={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"],[mt.Msg.MIXLY_TO_BITES,"b"],[mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:mt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},De={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:mt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},fe=Ce,Fe={init:function(){this.setColour(ue),this.appendValueInput("VAR").appendField(mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Pe={init:function(){this.setColour(ue),this.itemCount_=1,this.setMutator(new mt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(mt.Msg.MIXLY_PRODUCT+mt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(mt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(mt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const xe={init:function(){this.setColour(ve),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new mt.FieldTextInput("",mt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(mt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new mt.FieldImage(e,7,12,'"')}},ye={init:function(){this.setColour(ve),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(mt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},be={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ve={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String).appendField(mt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Be={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ge={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ue={init:function(){this.WHERE_OPTIONS=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.TEXT_GET_INDEX_RANDOM+1+mt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.LISTS_GET_INDEX_GET,"MODE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(mt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+mt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",mt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:mt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:mt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:mt.Msg.TEXT_GET_INDEX_RANDOM};return mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+mt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==mt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new mt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},we={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.LISTS_GET_INDEX_FROM_START+"n"+mt.Msg.TEXT_CHARAT2)}},ke={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(mt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(mt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},He={init:function(){this.WHERE_OPTIONS_1=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[mt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==mt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new mt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},We={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(mt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ke={init:function(){var t=[[mt.Msg.MIXLY_EQUALS,"==="],[mt.Msg.MIXLY_STARTSWITH,"startswith"],[mt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new mt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Je={init:function(){this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_COMPARETO_HELP)}},qe={init:function(){var t=[[mt.Msg.TEXT_UPPER,"upper"],[mt.Msg.TEXT_TITLE,"title"],[mt.Msg.TEXT_CAPITALIZE,"capitalize"],[mt.Msg.TEXT_SWAPCASE,"swapcase"],[mt.Msg.TEXT_LOWER,"lower"]];this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:mt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:mt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:mt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:mt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:mt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Qe={init:function(){var t=[[mt.Msg.TEXT_LJUST,"ljust"],[mt.Msg.TEXT_CENTER,"center"],[mt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ve),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(mt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(mt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(mt.Msg.MIXLY_MID+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(mt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},je={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(mt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},$e={init:function(){this.setColour(ve),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(mt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(mt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ti={init:function(){var t=[[mt.Msg.TEXT_TRIM_BOTH,"strip"],[mt.Msg.TEXT_TRIM_LEFT,"lstrip"],[mt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ve),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(mt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:mt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:mt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:mt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ei={init:function(){this.setColour(ve),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new mt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zi={init:function(){this.setColour(qi),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ji={init:function(){this.setColour(qi),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zi={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_KEYS),this.setTooltip(mt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_TOOLTIP)}},tn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},en={init:function(){this.setColour(qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},nn={init:function(){this.setColour(qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_DELETE_TOOLTIP)}},sn={init:function(){this.setColour(qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(mt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(mt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MID),this.setTooltip(mt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_n={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_CLEAR),this.setTooltip(mt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},on={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_ITEMS),this.setTooltip(mt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},pn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_VALUES),this.setTooltip(mt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},an={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LENGTH),this.setTooltip(mt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},un={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_DELDICT),this.setTooltip(mt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rn={init:function(){this.MODE=[[mt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[mt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(mt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=mt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=mt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new mt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},ln={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setTooltip(mt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},In={init:function(){this.setColour(qi),this.appendDummyInput("").appendField(new mt.FieldLabel(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new mt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Tn={init:function(){this.setColour(qi),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},hn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TO_JSON),this.setTooltip(mt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn={init:function(){this.setColour(qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},mn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En=210,On={init:function(){var t=mt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:mt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:mt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Rn={init:function(){var t=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new mt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},cn={init:function(){var t=[[mt.Msg.LOGIC_OPERATION_AND,"AND"],[mt.Msg.LOGIC_OPERATION_OR,"OR"],[mt.Msg.LOGIC_OPERATION_NOR,"NOR"],[mt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:mt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:mt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(mt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(mt.Msg.LOGIC_NEGATE_TOOLTIP)}},Cn={init:function(){var t=[[mt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[mt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new mt.FieldDropdown(t),"BOOL"),this.setTooltip(mt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Sn={init:function(){this.setColour(En),this.setOutput(!0),this.appendDummyInput().appendField(mt.Msg.LOGIC_NULL),this.setTooltip(mt.Msg.LOGIC_NULL_TOOLTIP)}},An={init:function(){this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(mt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(mt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Ln={init:function(){var t=[[mt.Msg.TEXT_APPEND_TO,"in"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new mt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(mt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.IN)}},Nn={init:function(){var t=[[mt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Dn={init:function(){this.setColour(En),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},fn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(mt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXPY_TEXT_ENCODE).appendField(new mt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MICROBIT_PYTHON_TYPE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.HTML_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Gn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Kn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+mt.Msg.MIXLY_ESP32_SET+{mkdir:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(mt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.HTML_FILE,"isfile"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(mt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(mt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Zn={};Zn.NAME_TYPE=mt.PROCEDURE_CATEGORY_NAME,Zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_FORM_CONTENT).appendField(new mt.FieldDropdown([[mt.Msg.HTML_TEXT,"text"],[mt.Msg.HTML_EMAIL,"email"],[mt.Msg.HTML_NUMBER,"number"],[mt.Msg.HTML_PASSWORD,"password"],[mt.Msg.HTML_CHECKBOX,"checkbox"],[mt.Msg.HTML_RADIOBUTTON,"radiobutton"],[mt.Msg.HTML_BUTTON,"button"],[mt.Msg.HTML_COLOUR,"colour"],[mt.Msg.HTML_DATE,"date"],[mt.Msg.HTML_LOCALTIME,"local time"],[mt.Msg.HTML_FILE,"file"],[mt.Msg.HTML_HIDDEN,"hidden"],[mt.Msg.HTML_IMAGE,"image"],[mt.Msg.HTML_MONTH,"month"],[mt.Msg.HTML_RANGE,"range"],[mt.Msg.HTML_RESET,"reset"],[mt.Msg.HTML_SEARCH,"search"],[mt.Msg.HTML_SUBMIT,"submit"],[mt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[mt.Msg.HTML_TIME,"time"],[mt.Msg.HTML_URL,"url"],[mt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(mt.Msg.HTML_NAME).appendField(new mt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(mt.Msg.HTML_VALUE).appendField(new mt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_TEXT).appendField(new mt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs=160,$s={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new mt.FieldTable(""),"TEXT")}},t_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT")}},e_={init:function(){this.setColour(Zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},i_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},n_={init:function(){this.setColour(Zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new mt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},s_={init:function(){this.setColour(Zs),this.appendValueInput("VALUE").appendField(mt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},__={init:function(){this.setColour(Zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(mt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=mt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},mt.isNumber(n)&&mt.isNumber(s)&&mt.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const Qp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},jp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Zp=function(t,e){return["None",e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ta=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ia=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},na=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},sa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},_a=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},oa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},pa=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},aa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ua=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ha=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ma=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ma=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ea=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Sa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},La=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),mt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ru=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lu=function(t,e){return'"},du=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Iu=function(){return this.getFieldValue("TEXT")+"\n"},Tu=function(t){return t.getFieldValue("TEXT")+"\n"},hu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Mu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},mu=function(){return""},Eu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ou=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},cu.scrubNakedValue=function(t){return t+"\n"},cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=mt.utils.string.wrap(_,cu.COMMENT_WRAP-3),n+=cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const gu="#74A55B",Cu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Su={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Au={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Lu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Nu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Du={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},vu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Yu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Xu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},xu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},bu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField("360°"+mt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SETTING+mt.Msg.blockpy_turtle_rotate+mt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Vu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Gu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Uu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},wu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new mt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(mt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},ku={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[mt.Msg.MOTOR_N,"ms32006.MOT_N"],[mt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Hu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new mt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Wu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Ku={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Ju={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new mt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+mt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ju={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},$u={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},tr={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},er={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},nr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LISTS_SET_INDEX_SET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},_r={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},or={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[mt.Msg.MIXLY_SPEED,"[1]"],[mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[mt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[mt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[mt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ar={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},hr="#6C9858",Mr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},mr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_ON,"1"],[mt.Msg.MIXLY_ESP32_OFF,"0"],[mt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Er={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Or={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},cr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},gr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LCD_SETCOLOR).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LIGHT_RED,"1"],[mt.Msg.MIXLY_LIGHT_GREEN,"2"],[mt.Msg.MIXLY_LIGHT_BLUE,"3"],[mt.Msg.MIXLY_LIGHT_YELLOW,"4"],[mt.Msg.MIXLY_LIGHT_CYAN,"5"],[mt.Msg.MIXLY_LIGHT_PURPLE,"6"],[mt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Sr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ar={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Lr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Nr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Dr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},fr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Fr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Pr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},vr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Yr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Xr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},xr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},yr={init:function(){this.setColour(hr),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},br={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Vr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Br={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Gr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ur={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wr={init:function(){this.setColour(hr),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},kr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(hr),this.appendDummyInput().appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Kr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Qr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},jr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"1"],[mt.Msg.TEXT_TRIM_RIGHT,"2"],[mt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},el={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"0"],[mt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(hr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(hr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_RECORD_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},al={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},rl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ll={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},dl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Il={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.MIXLY_ALL+mt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(mt.ALIGN_RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Tl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(mt.Msg.MIXLY_RELEASE).appendField(new mt.FieldDropdown([[mt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[mt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT)}},hl={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SPECIAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[mt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[mt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[mt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[mt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[mt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[mt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Ml={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GENERAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ml={init:function(){this.setColour(hr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new mt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(mt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(mt.Msg.MIXLY_WIFI_USERNAME).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(mt.Msg.MIXLY_IOT_PASSWORD).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_PROJECT).setAlign(mt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(mt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},$m={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_SUBSCRIBE+mt.Msg.MIXLY_MICROBIT_MSG).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(mt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},tE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},sE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},_E={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},oE={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},pE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},aE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(mt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},uE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+mt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lE={init:function(){this.VISITOR_ID=Et.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Um),this.appendDummyInput("").appendField(new mt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},dE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},IE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(mt.Msg.MIXLY_REQUESTS_GET).appendField(mt.Msg.MIXLY_GET_CURRENT_TIME).appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},hE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(mt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(mt.Msg.MQTT_Topic).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ME={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mE=wm,EE=km,OE=Hm,RE=Wm,cE=Jm,gE=225,CE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(mt.Msg.MIXLY_NETWORK_MODE).appendField(new mt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},SE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[mt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=mt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:mt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:mt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},AE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},LE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:mt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},NE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(mt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(mt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},DE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_CONNECT+mt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},fE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[mt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:mt.Msg.MIXLY_ESP32_NETWORK_IP,1:mt.Msg.MIXLY_ESP32_NETWORK_MASK,2:mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},FE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},PE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},vE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(mt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},YE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},XE={init:function(){this.setColour(gE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new mt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},xE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},yE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},bE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},VE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},BE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},GE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},UE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},wE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},kE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},HE={init:function(){this.setColour(gE),this.appendValueInput("DOMAIN").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS_GET).appendField(new mt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},WE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:mt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:mt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:mt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},KE={init:function(){this.appendValueInput("VAR").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:mt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:mt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},JE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(mt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},qE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(new mt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},QE="#3288dd",zE={init:function(){this.setColour(QE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS).appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},jE={init:function(){this.setColour(QE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(mt.Msg.blockpy_REQUESTS+mt.Msg.OLED_STRING),this.appendDummyInput("").appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},ZE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[mt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(QE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},$E=100,tO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},eO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},iO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(mt.Msg.MOTOR_DC).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(mt.Msg.MOTOR_DC).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},sO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},_O={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},oO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+mt.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO="#A58C5B",uO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_IS_PRESSED)}},rO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_WAS_PRESSED)}},lO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_BUTTON+mt.Msg.MIXLY_GET_PRESSES)}},dO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},IO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"],[mt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down,freefall:mt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},TO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},hO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},MO={init:function(){var t=[[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(aO),this.appendValueInput("PIN",Number).appendField(new mt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},mO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},EO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},OO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"left"],[mt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(mt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=mt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=mt.Msg.MIXLY_ESP32_NEAR;return i+{left:mt.Msg.TEXT_TRIM_LEFT,right:mt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},RO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[mt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},cO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[mt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},gO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField("DS18X20 "+mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},CO={init:function(){this.setColour(aO),this.appendDummyInput("").appendField("LM35"+mt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LM35)}},SO={init:function(){this.setColour(aO),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},AO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[mt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[mt.Msg.MIXLY_ESP32_MAX30102_IR+","+mt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[mt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[mt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},NO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+mt.Msg.HTML_COLOUR,"[2]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_IR_STRENGTH,"[1]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},fO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+"RGB"+mt.Msg.HTML_COLOUR,"0"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_RGB_RAW,"1"],[mt.Msg.MIXLY_GET_ENV_LIGHT+mt.Msg.MIXLY_BRIGHTNESS,"2"],[mt.Msg.GET_IR_STRENGTH+mt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},FO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[mt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},PO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},vO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},YO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},XO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},xO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},yO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MIXGOPE_FIELD+mt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[mt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},bO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},VO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},BO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET+mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},GO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+mt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},UO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},wO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_GETTEMPERATUE)}},kO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},HO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},WO={init:function(){this.setColour(aO),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},KO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[mt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},JO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},qO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},jO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},$O={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},tR={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},eR={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},aD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},rD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},lD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},TD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},hD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},MD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},mD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},ED=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},OD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},RD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},cD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},gD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},CD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},SD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},AD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},LD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},ND=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},DD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},fD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},FD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},PD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},vD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},YD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},XD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},xD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},yD=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},bD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},VD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},BD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},GD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},UD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Et.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},wD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},kD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},HD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},WD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},KD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},JD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},qD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},QD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},zD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},jD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ZD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},$D=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},tf=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Et.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},nf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},sf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},_f=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},of=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},pf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},af=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},rf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},lf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},df=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},If=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},Tf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},hf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},Mf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},mf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Ef=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},Of=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},Rf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},cf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},gf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},Cf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Sf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Af=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},nF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},sF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},_F=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},oF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},pF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},aF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},uF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},rF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},lF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},dF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},IF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},TF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},hF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},MF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},mF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},EF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},OF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},RF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},cF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},gF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},CF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},SF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},AF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},LF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},NF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Fx=function(){return"control.reset()\n"},Px=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},vx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},Yx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Xx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},xx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},yx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},bx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Vx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Bx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Gx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Ux=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},wx=function(){return"while True:\n pass\n"},kx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},Hx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Wx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Kx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Jx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},qx=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Qx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},zx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},jx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},Zx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},$x=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},ty=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},ey=zx,iy=qx,ny=Qx,sy=Wx,_y=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},oy=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},py=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ay=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},uy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ry=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ly=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},dy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Ty=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},hy=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},My=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},my=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Oy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Ry={};Ry["MixGo CE"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Et.Profile.generate(["0-18","21-46"]),input_pin:Et.Profile.generate(["0-18","21-46"]),output_pin:Et.Profile.generate(["0-18","21-45"]),pwm_input:Et.Profile.generate(["0-18","21-46"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-18","21-46"],"adc","adc"),pwm_output:Et.Profile.generate(["0-18","21-45"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-18","21-45"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-18","21-45"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-18","21-45"]),pwm:Et.Profile.generate(["0-18","21-45"],"pwm","pwm"),analog_pin:Et.Profile.generate(["1-18"]),analog:Et.Profile.generate(["1-18"],"adc","adc"),dac_pin:Et.Profile.generate(["17-18"]),dac:Et.Profile.generate(["17-18"],"dac","dac"),touch:Et.Profile.generate(["1-14"],"tc","tc"),touch_pin:Et.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-15"]),exlcdv:Et.Profile.generate(["0-7"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Ry["ESP32S2 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-42","45"]),input_pin:Et.Profile.generate(["0-42","45-46"]),output_pin:Et.Profile.generate(["0-42","45"]),pwm_input:Et.Profile.generate(["0-42","45-46"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-18","21-46"],"adc","adc"),pwm_output:Et.Profile.generate(["0-42","45"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-42","45"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-42","45"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-42","45"]),pwm:Et.Profile.generate(["0-42","45"],"pwm","pwm"),analog_pin:Et.Profile.generate(["1-20"]),analog:Et.Profile.generate(["1-20"],"adc","adc"),dac_pin:Et.Profile.generate(["17-18"]),dac:Et.Profile.generate(["17-18"],"dac","dac"),touch:Et.Profile.generate(["1-14"],"tc","tc"),touch_pin:Et.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-15"]),exlcdv:Et.Profile.generate(["0-7"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const cy=Ry,gy=20,Cy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_HIGH,"HIGH"],[mt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},Sy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},Ay={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},Ly={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},Ny={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_mSecond,"period"],[mt.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Dy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_REF_VOLTAGE+mt.Msg.MIXLY_STAT).appendField(new mt.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},fy={init:function(){this.setColour(gy),this.appendValueInput("pin").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},Fy={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Py={init:function(){this.setColour(20),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_AS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[mt.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[mt.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[mt.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},vy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("dac#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Yy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("tc#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Xy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField("PWM"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_FREQUENCY+mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},xy=Py,yy=Yy,by=fy,Vy=Fy,By=230,Gy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital),"PIN"),this.setOutput(!0)}},Uy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},wy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},ky={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},Hy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},Wy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},Ky={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},Jy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},qy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Qy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},zy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},jy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Zy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},eb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog),"PIN"),this.setOutput(!0)}},nb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},sb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac),"PIN"),this.setOutput(!0)}},_b={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},ob={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},pb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm),"PIN"),this.setOutput(!0)}},ub={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch),"PIN"),this.setOutput(!0)}},db={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Tb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},hb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.imglist),"PIN"),this.setOutput(!0)}},Mb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist),"PIN"),this.setOutput(!0)}},mb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},Eb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},cb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},gb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Cb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Sb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Ab={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Lb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Nb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Db={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.one_more),"PIN"),this.setOutput(!0)}},fb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},Fb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},Pb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},vb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Yb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},Xb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},xb=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},yb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},bb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},Vb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},Bb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},Gb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},Ub=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},wb=Ub,kb=Ub,Hb=Ub,Wb=Ub,Kb=Ub,Jb=Ub,qb=Ub,Qb=Ub,zb=Ub,jb=Ub,Zb=Ub,$b=Ub,tV=Ub,eV=Ub,iV=Ub,nV=Ub,sV=Ub,_V=Ub,oV=Ub,pV=Ub,aV=Ub,uV=Ub,rV=Ub,lV=Ub,dV=Ub,IV=Ub,TV=Ub,hV=Ub,MV=Ub,mV=Ub,EV=Ub,OV=Ub,RV=Ub,cV=Ub,gV=Ub,CV=Ub,SV=Ub,AV=Ub,LV=Ub,NV=Ub,DV=Ub,fV=Ub,FV=Ub,PV=Ub;Object.assign(mt.Variables,Rt),Object.assign(mt.Procedures,$n),mt.Python=cu,mt.generator=cu,Et.Profile.default={},Object.assign(Et.Profile,cy),Object.assign(Et.Profile.default,cy["MixGo CE"]),Object.assign(mt.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,V,W,H,X,B,K,f,k,w,U,G,F,D,N,y,x,b,P,v,Y,It,Tt),Object.assign(mt.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,st,lt,rt,tt,_t,dt,Q,ut,at,pt,ot,z,q,J,it,et,nt,j,Z,$,ht,Mt)})(); \ No newline at end of file +class ct{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(mt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Gt={init:function(){this.setColour(Xt),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ut={init:function(){this.setColour(Xt),this.appendValueInput("LIST").setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(mt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wt={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new mt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(mt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:mt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(mt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ht={init:function(){this.setColour(Xt);var t=new mt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:mt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Wt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new mt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return mt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};wt.OPERATORS=[[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Ht.OPERATORS=[[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[mt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(mt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},jt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Zt={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(mt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},$t={init:function(){this.jsonInit({message0:mt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Xt,tooltip:mt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:mt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},te={init:function(){this.setColour(Xt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_STAT),this.setOutput(!0)}},ee={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},ie={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ne={init:function(){this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+mt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(mt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new mt.FieldDropdown([[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[mt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Xt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},se={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_e={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},oe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},pe={init:function(){this.setColour(Xt),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_GET_UNIQUE_IDEN)}},ae={init:function(){this.setColour(Xt),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(mt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ue=230;mt.FieldTextInput.math_number_validator=function(t){return String(t)},mt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const re={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},le={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},de={init:function(){this.setColour(ue);this.appendDummyInput("").appendField(mt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new mt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:mt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ie={init:function(){this.setColour(ue),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Te={init:function(){this.setColour(ue),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:mt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:mt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:mt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:mt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:mt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},he={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new mt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Me={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:mt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:mt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:mt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:mt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:mt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:mt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:mt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},me={init:function(){var t=[[mt.Msg.MATH_BIN,"bin"],[mt.Msg.MATH_OCT,"oct"],[mt.Msg.MATH_HEX,"hex"]];this.setColour(ue),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:mt.Msg.MATH_DEC_TOOLTIP_BIN,oct:mt.Msg.MATH_DEC_TOOLTIP_OCT,hex:mt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ee={init:function(){var t=[[mt.Msg.LANG_MATH_TO_ROUND,"round"],[mt.Msg.LANG_MATH_TO_CEIL,"ceil"],[mt.Msg.LANG_MATH_TO_FLOOR,"floor"],[mt.Msg.MATH_ABS,"fabs"],[mt.Msg.MATH_SQRT,"sqrt"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).appendField(new mt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:mt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:mt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:mt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:mt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:mt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:mt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Oe={init:function(){var t=[[mt.Msg.MIXLY_MAX,"max"],[mt.Msg.MIXLY_MIN,"min"]];this.setColour(ue),this.appendValueInput("A").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(mt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:mt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:mt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Re={init:function(){var t=[[mt.Msg.MATH_TWO,"two"],[mt.Msg.MATH_EIGHT,"eight"],[mt.Msg.MATH_TEN,"ten"],[mt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ue),this.appendDummyInput("").appendField(mt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new mt.FieldDropdown(t),"OP").appendField(mt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MATH_ZHW).appendField(new mt.FieldDropdown(t),"OP2").appendField(mt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:mt.Msg.MATH_Before_two,eight:mt.Msg.MATH_Before_eight,ten:mt.Msg.MATH_Before_ten,sixteen:mt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:mt.Msg.MATH_Behind_two,eight:mt.Msg.MATH_Behind_eight,ten:mt.Msg.MATH_Behind_ten,sixteen:mt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},ce={init:function(){var t=[[mt.Msg.LANG_MATH_INT,"int"],[mt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ue),this.setOutput(!0,Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new mt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(mt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:mt.Msg.LANG_MATH_INT,float:mt.Msg.LANG_MATH_FLOAT_RANDOM};return mt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(mt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ce={init:function(){this.setColour(ue),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(mt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(mt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Se={init:function(){this.setColour(ue),this.appendDummyInput().appendField(new mt.FieldTextInput("0",mt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(mt.Msg.MATH_NUMBER_TOOLTIP)}},Ae={init:function(){this.setColour(ue),this.appendValueInput("NUM").setCheck(Number).appendField(mt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Le={init:function(){this.setColour(ue),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MATH_ROUND).appendField(mt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(mt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(mt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ne={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"],[mt.Msg.MIXLY_TO_BITES,"b"],[mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:mt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:mt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},De={init:function(){var t=[[mt.Msg.MIXLY_TO_INT,"int"],[mt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ue),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:mt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:mt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},fe=Ce,Fe={init:function(){this.setColour(ue),this.appendValueInput("VAR").appendField(mt.Msg.LANG_MATH_BYTE+mt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Pe={init:function(){this.setColour(ue),this.itemCount_=1,this.setMutator(new mt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(mt.Msg.MIXLY_PRODUCT+mt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(mt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(mt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(mt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const xe={init:function(){this.setColour(ve),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new mt.FieldTextInput("",mt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(mt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new mt.FieldImage(e,7,12,'"')}},ye={init:function(){this.setColour(ve),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(mt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},be={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ve={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String).appendField(mt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Be={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ge={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ue={init:function(){this.WHERE_OPTIONS=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.TEXT_GET_INDEX_RANDOM+1+mt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.LISTS_GET_INDEX_GET,"MODE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(mt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=mt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+mt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",mt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:mt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:mt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:mt.Msg.TEXT_GET_INDEX_RANDOM};return mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+mt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==mt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new mt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),mt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},we={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.LISTS_GET_INDEX_FROM_START+"n"+mt.Msg.TEXT_CHARAT2)}},ke={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(mt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(mt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},He={init:function(){this.WHERE_OPTIONS_1=[[mt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[mt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[mt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[mt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==mt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),mt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(mt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new mt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},We={init:function(){this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(mt.Msg.LISTS_GET_INDEX_GET+" "+mt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(mt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(mt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(mt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ke={init:function(){var t=[[mt.Msg.MIXLY_EQUALS,"==="],[mt.Msg.MIXLY_STARTSWITH,"startswith"],[mt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new mt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Je={init:function(){this.setColour(ve),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_COMPARETO_HELP)}},qe={init:function(){var t=[[mt.Msg.TEXT_UPPER,"upper"],[mt.Msg.TEXT_TITLE,"title"],[mt.Msg.TEXT_CAPITALIZE,"capitalize"],[mt.Msg.TEXT_SWAPCASE,"swapcase"],[mt.Msg.TEXT_LOWER,"lower"]];this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:mt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:mt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:mt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:mt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:mt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Qe={init:function(){var t=[[mt.Msg.TEXT_LJUST,"ljust"],[mt.Msg.TEXT_CENTER,"center"],[mt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ve),this.appendValueInput("VAR").appendField(new mt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(mt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(mt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(mt.Msg.MIXLY_MID+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(mt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},je={init:function(){this.setColour(ve),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ze={init:function(){this.setColour(ve),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(mt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(mt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},$e={init:function(){this.setColour(ve),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(mt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(mt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ti={init:function(){var t=[[mt.Msg.TEXT_TRIM_BOTH,"strip"],[mt.Msg.TEXT_TRIM_LEFT,"lstrip"],[mt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ve),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(mt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:mt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:mt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:mt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ei={init:function(){this.setColour(ve),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new mt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zi={init:function(){this.setColour(qi),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ji={init:function(){this.setColour(qi),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Zi={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_KEYS),this.setTooltip(mt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_TOOLTIP)}},tn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(mt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},en={init:function(){this.setColour(qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(mt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},nn={init:function(){this.setColour(qi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(mt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_DELETE_TOOLTIP)}},sn={init:function(){this.setColour(qi),this.appendValueInput("DICT2").setCheck("Dict").appendField(mt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(mt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MID),this.setTooltip(mt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_n={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_CLEAR),this.setTooltip(mt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},on={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_ITEMS),this.setTooltip(mt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},pn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_VALUES),this.setTooltip(mt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},an={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LENGTH),this.setTooltip(mt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},un={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.DICT_DELDICT),this.setTooltip(mt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rn={init:function(){this.MODE=[[mt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[mt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(mt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(mt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=mt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=mt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==mt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new mt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},ln={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(mt.Msg.DICTS_ADD_VALUE),this.setTooltip(mt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(mt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(mt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},In={init:function(){this.setColour(qi),this.appendDummyInput("").appendField(new mt.FieldLabel(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new mt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Tn={init:function(){this.setColour(qi),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},hn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TO_JSON),this.setTooltip(mt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn={init:function(){this.setColour(qi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},mn={init:function(){this.setColour(qi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},En=210,On={init:function(){var t=mt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:mt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:mt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:mt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:mt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Rn={init:function(){var t=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=mt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new mt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},cn={init:function(){var t=[[mt.Msg.LOGIC_OPERATION_AND,"AND"],[mt.Msg.LOGIC_OPERATION_OR,"OR"],[mt.Msg.LOGIC_OPERATION_NOR,"NOR"],[mt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new mt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:mt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:mt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:mt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(En),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(mt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(mt.Msg.LOGIC_NEGATE_TOOLTIP)}},Cn={init:function(){var t=[[mt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[mt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(En),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new mt.FieldDropdown(t),"BOOL"),this.setTooltip(mt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Sn={init:function(){this.setColour(En),this.setOutput(!0),this.appendDummyInput().appendField(mt.Msg.LOGIC_NULL),this.setTooltip(mt.Msg.LOGIC_NULL_TOOLTIP)}},An={init:function(){this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(mt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(mt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Ln={init:function(){var t=[[mt.Msg.TEXT_APPEND_TO,"in"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new mt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(mt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.IN)}},Nn={init:function(){var t=[[mt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[mt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(En),this.appendValueInput("A"),this.appendValueInput("B").appendField(new mt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Dn={init:function(){this.setColour(En),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},fn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(mt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXPY_TEXT_ENCODE).appendField(new mt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_USE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=mt.Msg.MIXLY_BELONG,o=mt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+mt.Msg.MIXLY_MICROBIT_TYPE_STRING+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MICROBIT_PYTHON_TYPE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.HTML_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Gn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Kn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+mt.Msg.MIXLY_ESP32_SET+{mkdir:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(mt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.HTML_FILE,"isfile"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+mt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(mt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(mt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Zn={};Zn.NAME_TYPE=mt.PROCEDURE_CATEGORY_NAME,Zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_FORM_CONTENT).appendField(new mt.FieldDropdown([[mt.Msg.HTML_TEXT,"text"],[mt.Msg.HTML_EMAIL,"email"],[mt.Msg.HTML_NUMBER,"number"],[mt.Msg.HTML_PASSWORD,"password"],[mt.Msg.HTML_CHECKBOX,"checkbox"],[mt.Msg.HTML_RADIOBUTTON,"radiobutton"],[mt.Msg.HTML_BUTTON,"button"],[mt.Msg.HTML_COLOUR,"colour"],[mt.Msg.HTML_DATE,"date"],[mt.Msg.HTML_LOCALTIME,"local time"],[mt.Msg.HTML_FILE,"file"],[mt.Msg.HTML_HIDDEN,"hidden"],[mt.Msg.HTML_IMAGE,"image"],[mt.Msg.HTML_MONTH,"month"],[mt.Msg.HTML_RANGE,"range"],[mt.Msg.HTML_RESET,"reset"],[mt.Msg.HTML_SEARCH,"search"],[mt.Msg.HTML_SUBMIT,"submit"],[mt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[mt.Msg.HTML_TIME,"time"],[mt.Msg.HTML_URL,"url"],[mt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(mt.Msg.HTML_NAME).appendField(new mt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(mt.Msg.HTML_VALUE).appendField(new mt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(mt.Msg.MIXLY_AIP_ATTR).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(Us),this.appendDummyInput().appendField(new mt.FieldTextInput("property"),"KEY").appendField(":").appendField(new mt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Us),this.appendDummyInput().appendField(mt.Msg.HTML_TEXT).appendField(new mt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs=160,$s={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new mt.FieldTable(""),"TEXT")}},t_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT")}},e_={init:function(){this.setColour(Zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new mt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},i_={init:function(){this.setColour(Zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},n_={init:function(){this.setColour(Zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new mt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},s_={init:function(){this.setColour(Zs),this.appendValueInput("VALUE").appendField(mt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},__={init:function(){this.setColour(Zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new mt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(mt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=mt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},mt.isNumber(n)&&mt.isNumber(s)&&mt.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const Qp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},zp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},jp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Zp=function(t,e){return["None",e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ta=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ia=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},na=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},sa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},_a=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},oa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},pa=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},aa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ua=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},la=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ta=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ha=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ma=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ma=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ea=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Sa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Aa=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},La=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),mt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},au=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},uu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ru=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lu=function(t,e){return'"},du=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Iu=function(){return this.getFieldValue("TEXT")+"\n"},Tu=function(t){return t.getFieldValue("TEXT")+"\n"},hu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Mu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},mu=function(){return""},Eu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ou=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},cu.scrubNakedValue=function(t){return t+"\n"},cu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},cu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},cu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=mt.utils.string.wrap(_,cu.COMMENT_WRAP-3),n+=cu.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const gu="#74A55B",Cu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Su={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Au={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Lu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Nu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Du={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Fu={init:function(){this.setColour(gu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},vu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Yu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Xu={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},xu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},bu={init:function(){this.setColour(gu),this.appendValueInput("VAR").appendField("360°"+mt.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SETTING+mt.Msg.blockpy_turtle_rotate+mt.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Vu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Bu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Gu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Uu={init:function(){this.setColour(gu),this.appendValueInput("PIN",Number).appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},wu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new mt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(mt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},ku={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[mt.Msg.MOTOR_N,"ms32006.MOT_N"],[mt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},Hu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new mt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[mt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Wu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_RGB_PIN_COUNT)}},Ku={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Ju={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Qu={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new mt.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+mt.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ju={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Zu={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},$u={init:function(){this.setColour(gu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(mt.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(mt.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(mt.Msg.MIXLY_PROGRAM_BLOCK).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},tr={init:function(){this.setColour(gu),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},er={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},nr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_TRAFFIC_LIGHT).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.LISTS_SET_INDEX_SET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[mt.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},sr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},_r={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_WHITE,"W"],[mt.Msg.COLOUR_RGB_RED,"R"],[mt.Msg.COLOUR_RGB_YELLOW,"Y"],[mt.Msg.COLOUR_RGB_GREEN,"G"],[mt.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},or={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[mt.Msg.MIXLY_SPEED,"[1]"],[mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[mt.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[mt.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[mt.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[mt.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ar={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MATH_SINGLE_OP_ABSOLUTE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},dr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.ME_GO_MOTOR_EXTERN+mt.Msg.MIXLY_SERVO_MOTOR).appendField(mt.Msg.MIXLY_RELATIVE+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+mt.Msg.MSG.run).appendField("("+mt.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LEFT,"0"],[mt.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MODE).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPEED+mt.Msg.MIXLY_MODE,"0"],[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER+mt.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(mt.inputs.Align.RIGHT).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"0"],[mt.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(gu),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.ME_GO_MOTOR_EXTERN).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MOTOR,"ext_motor"],[mt.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[mt.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[mt.Msg.COLOUR_RGB_RED+"LED","R_LED"],[mt.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[mt.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[mt.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[mt.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},hr="#6C9858",Mr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},mr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_ON,"1"],[mt.Msg.MIXLY_ESP32_OFF,"0"],[mt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Er={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Or={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Rr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},cr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},gr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(mt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(mt.Msg.MIXLY_LCD_SETCOLOR).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_LIGHT_RED,"1"],[mt.Msg.MIXLY_LIGHT_GREEN,"2"],[mt.Msg.MIXLY_LIGHT_BLUE,"3"],[mt.Msg.MIXLY_LIGHT_YELLOW,"4"],[mt.Msg.MIXLY_LIGHT_CYAN,"5"],[mt.Msg.MIXLY_LIGHT_PURPLE,"6"],[mt.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Sr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ar={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(mt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Lr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETTING).appendField(mt.Msg.MIXLY_BUILDIN_LED).appendField(new mt.FieldDropdown([[mt.Msg.COLOUR_RGB_RED,"r"],[mt.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_BUILDIN_LED+mt.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Nr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(new mt.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Dr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},fr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Fr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Pr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},vr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Yr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Et.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(mt.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Xr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(mt.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},xr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(mt.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.PYTHON_RANGE_STEP).appendField(mt.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},yr={init:function(){this.setColour(hr),this.appendValueInput("TICKS").setCheck(Number).appendField(mt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(mt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(mt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},br={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Vr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Br={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Gr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(mt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ur={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wr={init:function(){this.setColour(hr),this.appendValueInput("LIST").appendField(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},kr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(hr),this.appendDummyInput().appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(hr),this.appendDummyInput("").appendField("MixGo Car").appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Kr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MOTOR_DC).appendField(new mt.FieldDropdown([[mt.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[mt.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_STOP).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Qr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},jr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"1"],[mt.Msg.TEXT_TRIM_RIGHT,"2"],[mt.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[mt.Msg.MIXLY_SPEED,"SPEED"],[mt.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Zr={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[mt.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.blockpy_forward,"F"],[mt.Msg.blockpy_backward,"B"],[mt.Msg.blockpy_left,"L"],[mt.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(new mt.FieldDropdown([[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},el={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.BITBOT).appendField(mt.Msg.MIXLY_MOTOR).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"0"],[mt.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},il={init:function(){this.setColour(hr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(hr),this.appendValueInput("bright").appendField(mt.Msg.MIXLY_SETTING+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_SETONOFF)}},_l={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MIXBOT_BUZZER+mt.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_LED_GETONOFF)}},ol={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_RECORD_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_AUDIO).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},al={init:function(){this.setColour(hr),this.appendValueInput("PATH").appendField(mt.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ul={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(mt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},rl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ll={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},dl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.PIN_NUMBERING).appendField(new mt.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},Il={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.LISTS_SET_INDEX_SET+mt.Msg.ME_GO_MOTOR_EXTERN).appendField(mt.Msg.MIXLY_ALL+mt.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(mt.ALIGN_RIGHT).appendField(mt.Msg.blynk_IOT_IR_POWER+mt.Msg.MIXLY_PINMODEOUT+mt.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Tl={init:function(){this.setColour(hr),this.appendDummyInput().appendField(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(mt.Msg.MIXLY_RELEASE).appendField(new mt.FieldDropdown([[mt.Msg.MICROPYTHON_DISPLAY_YES,"True"],[mt.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.ANALOG+mt.Msg.MIXLY_KEYBOARD_INPUT)}},hl={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SPECIAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[mt.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[mt.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[mt.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[mt.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[mt.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[mt.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[mt.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Ml={init:function(){this.setColour(hr),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GENERAL_KEY).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ml={init:function(){this.setColour(hr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new mt.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(mt.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Qm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},jm={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(mt.Msg.MIXLY_WIFI_USERNAME).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(mt.Msg.MIXLY_IOT_PASSWORD).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(mt.Msg.MIXLY_EMQX_PROJECT).setAlign(mt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(mt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},$m={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(mt.Msg.MIXLY_EMQX_SUBSCRIBE+mt.Msg.MIXLY_MICROBIT_MSG).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(mt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},tE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},sE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(mt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},_E={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},oE={init:function(){this.setColour(Um),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},pE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(mt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},aE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(mt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},uE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+mt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rE={init:function(){this.setColour(Um),this.appendDummyInput().appendField(mt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(mt.Msg.MIXLY_EMQX_SERVER).setAlign(mt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(mt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lE={init:function(){this.VISITOR_ID=Et.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Um),this.appendDummyInput("").appendField(new mt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},dE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MixIO").appendField(mt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},IE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(mt.Msg.MIXLY_REQUESTS_GET).appendField(mt.Msg.MIXLY_GET_CURRENT_TIME).appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("HTTP"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},hE={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(mt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(mt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(mt.Msg.MQTT_Topic).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(mt.Msg.MIXLY_OPEN_DEBUG).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[mt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ME={init:function(){this.setColour(Um),this.appendDummyInput().appendField("MQTT"+mt.Msg.MIXLY_Client).appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[mt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[mt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},mE=wm,EE=km,OE=Hm,RE=Wm,cE=Jm,gE=225,CE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(mt.Msg.MIXLY_NETWORK_MODE).appendField(new mt.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},SE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[mt.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=mt.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:mt.Msg.MIXLY_NETWORK_WIFI_OPEN,False:mt.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},AE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},LE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return mt.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:mt.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},NE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(mt.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(mt.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},DE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_NETWORK_WIFI_CONNECT+mt.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},fE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[mt.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:mt.Msg.MIXLY_ESP32_NETWORK_IP,1:mt.Msg.MIXLY_ESP32_NETWORK_MASK,2:mt.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},FE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},PE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},vE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(mt.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(mt.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},YE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},XE={init:function(){this.setColour(gE),this.appendValueInput("VAR").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new mt.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},xE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},yE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},bE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},VE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},BE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},GE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},UE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},wE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},kE={init:function(){this.setColour(gE),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},HE={init:function(){this.setColour(gE),this.appendValueInput("DOMAIN").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS_GET).appendField(new mt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},WE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:mt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:mt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:mt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},KE={init:function(){this.appendValueInput("VAR").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(mt.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:mt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:mt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},JE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(mt.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},qE={init:function(){this.setColour(gE),this.appendDummyInput("").appendField(new mt.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},QE="#3288dd",zE={init:function(){this.setColour(QE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS).appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},jE={init:function(){this.setColour(QE),this.appendValueInput("URL").appendField(mt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(mt.Msg.blockpy_CONDUCT).appendField(new mt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(mt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(mt.Msg.blockpy_REQUESTS+mt.Msg.OLED_STRING),this.appendDummyInput("").appendField(mt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},ZE={init:function(){this.appendValueInput("VAL");var t=[[mt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[mt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[mt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(QE),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},$E=100,tO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},eO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},iO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(mt.Msg.MOTOR_DC).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Direction).appendField(new mt.FieldDropdown([[mt.Msg.CLOCKWISE,"CW"],[mt.Msg.ANTI_CLOCKWISE,"CCW"],[mt.Msg.MOTOR_P,"P"],[mt.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(mt.Msg.MOTOR_DC).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},sO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_MOVE)}},_O={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(mt.inputs.Align.RIGHT).appendField(mt.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},oO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+mt.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){var t=Et.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour($E),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+mt.Msg.MIXLY_SERVO).appendField(mt.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET+mt.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO="#A58C5B",uO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_IS_PRESSED)}},rO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_SENOR_WAS_PRESSED)}},lO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(mt.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.PROCEDURES_DEFRETURN_RETURN+mt.Msg.MIXLY_BUTTON+mt.Msg.MIXLY_GET_PRESSES)}},dO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_BUTTON).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},IO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"],[mt.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down,freefall:mt.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},TO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},hO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},MO={init:function(){var t=[[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(aO),this.appendValueInput("PIN",Number).appendField(new mt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new mt.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:mt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},mO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},EO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},OO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new mt.FieldDropdown([[mt.Msg.TEXT_TRIM_LEFT,"left"],[mt.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(mt.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=mt.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=mt.Msg.MIXLY_ESP32_NEAR;return i+{left:mt.Msg.TEXT_TRIM_LEFT,right:mt.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},RO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[mt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":mt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},cO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[mt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},gO={init:function(){this.setColour(aO),this.appendValueInput("PIN",Number).appendField("DS18X20 "+mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},CO={init:function(){this.setColour(aO),this.appendDummyInput("").appendField("LM35"+mt.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(mt.Msg.MIXLY_TOOLTIP_LM35)}},SO={init:function(){this.setColour(aO),this.appendValueInput("I2CSUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},AO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[mt.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[mt.Msg.MIXLY_ESP32_MAX30102_IR+","+mt.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},LO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[mt.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[mt.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},NO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+mt.Msg.HTML_COLOUR,"[2]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_IR_STRENGTH,"[1]"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},fO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.HTML_COLOUR+mt.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET+"RGB"+mt.Msg.HTML_COLOUR,"0"],[mt.Msg.MIXLY_GET+mt.Msg.MIXLY_RGB_RAW,"1"],[mt.Msg.MIXLY_GET_ENV_LIGHT+mt.Msg.MIXLY_BRIGHTNESS,"2"],[mt.Msg.GET_IR_STRENGTH+mt.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},FO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GET_ENV_LIGHT,"E"],[mt.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},PO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},vO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},YO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[mt.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:mt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},XO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},xO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_Altitude+mt.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_GETPRESSURE,"pressure()"],[mt.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[mt.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},yO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MIXGOPE_FIELD+mt.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[mt.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},bO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_shake,"shake"],[mt.Msg.MIXLY_UP,"up"],[mt.Msg.MIXLY_DOWN,"down"],[mt.Msg.MIXLY_LEFT,"left"],[mt.Msg.MIXLY_RIGHT,"right"],[mt.Msg.MIXLY_MICROBIT_face_up,"face up"],[mt.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=mt.Msg.MIXLY_MICROBIT_JS_CURRENT,n=mt.Msg.MSG.catSensor,s=mt.Msg.MIXLY_MICROBIT_JS_STATE,_=mt.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:mt.Msg.MIXLY_MICROBIT_shake,up:mt.Msg.MIXLY_UP,down:mt.Msg.MIXLY_DOWN,left:mt.Msg.MIXLY_LEFT,right:mt.Msg.MIXLY_RIGHT,"face up":mt.Msg.MIXLY_MICROBIT_face_up,"face down":mt.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},VO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},BO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET+mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},GO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+mt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new mt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=mt.Msg.MIXLY_MICROBIT_Direction,s=mt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":mt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},UO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},wO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_GETTEMPERATUE)}},kO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return mt.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:mt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:mt.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},HO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},WO={init:function(){this.setColour(aO),this.appendValueInput("SPISUB").appendField(mt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(mt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP+mt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new mt.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},KO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[mt.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},JO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},qO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"+mt.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},QO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zO={init:function(){this.setColour(aO),this.appendDummyInput().appendField(mt.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(mt.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(mt.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(mt.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},jO={init:function(){this.setColour(aO),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RFID_SCAN_OK,"0"],[mt.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[mt.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZO={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new mt.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},$O={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},tR={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},eR={init:function(){this.setColour(aO),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new mt.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},aD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},rD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},lD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},TD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},hD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},MD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},mD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},ED=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},OD=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},RD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},cD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},gD=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},CD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},SD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},AD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},LD=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},ND=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},DD=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},fD=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},FD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},PD=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},vD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},YD=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},XD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},xD=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},yD=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},bD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},VD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},BD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},GD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},UD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Et.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},wD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},kD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},HD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},WD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},KD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},JD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},qD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},QD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},zD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},jD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ZD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},$D=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},tf=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Et.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},ef=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},nf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},sf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},_f=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},of=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},pf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},af=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},uf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},rf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},lf=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},df=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},If=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},Tf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},hf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},Mf=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},mf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Ef=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},Of=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},Rf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},cf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},gf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},Cf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Sf=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Af=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},nF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},sF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},_F=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},oF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},pF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},aF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},uF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},rF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},lF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},dF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},IF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},TF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},hF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},MF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},mF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},EF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},OF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},RF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},cF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},gF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},CF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},SF=function(t,e){var i=Et.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},AF=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},LF=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},NF=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},Fx=function(){return"control.reset()\n"},Px=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},vx=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+")\n"},Yx=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Et.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Xx=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},xx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},yx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},bx=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Vx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Bx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Gx=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Ux=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},wx=function(){return"while True:\n pass\n"},kx=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},Hx=function(t,e){return e.definitions_.import_os="import os","os.uname()"},Wx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Kx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},Jx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},qx=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Qx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},zx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},jx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},Zx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},$x=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},ty=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},ey=zx,iy=qx,ny=Qx,sy=Wx,_y=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},oy=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},py=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ay=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},uy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ry=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ly=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},dy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Iy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Ty=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},hy=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},My=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},my=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Ey=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Oy=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Ry={};Ry["MixGo CE"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Et.Profile.generate(["0-18","21-46"]),input_pin:Et.Profile.generate(["0-18","21-46"]),output_pin:Et.Profile.generate(["0-18","21-45"]),pwm_input:Et.Profile.generate(["0-18","21-46"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-18","21-46"],"adc","adc"),pwm_output:Et.Profile.generate(["0-18","21-45"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-18","21-45"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-18","21-45"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-18","21-45"]),pwm:Et.Profile.generate(["0-18","21-45"],"pwm","pwm"),analog_pin:Et.Profile.generate(["1-18"]),analog:Et.Profile.generate(["1-18"],"adc","adc"),dac_pin:Et.Profile.generate(["17-18"]),dac:Et.Profile.generate(["17-18"],"dac","dac"),touch:Et.Profile.generate(["1-14"],"tc","tc"),touch_pin:Et.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-15"]),exlcdv:Et.Profile.generate(["0-7"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Ry["ESP32S2 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Et.Profile.generate(["0-42","45"]),input_pin:Et.Profile.generate(["0-42","45-46"]),output_pin:Et.Profile.generate(["0-42","45"]),pwm_input:Et.Profile.generate(["0-42","45-46"],"pwm","pwm"),analog_input:Et.Profile.generate(["0-18","21-46"],"adc","adc"),pwm_output:Et.Profile.generate(["0-42","45"],"pwm","pwm"),analog_output:Et.Profile.generate(["0-42","45"],"adc","adc"),espnow_channel:Et.Profile.generate(["1-13"]),haskylens_model:Et.Profile.generate(["0-4"]),digital:Et.Profile.generate(["0-42","45"],"pin","pin"),pwm_pin:Et.Profile.generate(["0-42","45"]),pwm:Et.Profile.generate(["0-42","45"],"pwm","pwm"),analog_pin:Et.Profile.generate(["1-20"]),analog:Et.Profile.generate(["1-20"],"adc","adc"),dac_pin:Et.Profile.generate(["17-18"]),dac:Et.Profile.generate(["17-18"],"dac","dac"),touch:Et.Profile.generate(["1-14"],"tc","tc"),touch_pin:Et.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Et.Profile.generate(["0-4"]),exlcdh:Et.Profile.generate(["0-15"]),exlcdv:Et.Profile.generate(["0-7"]),brightness:Et.Profile.generate(["0-9"]),tts_voice:Et.Profile.generate(["0-16"]),tts_builtin_music:Et.Profile.generate(["0-47"]),tts_bgmusic:Et.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const cy=Ry,gy=20,Cy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_HIGH,"HIGH"],[mt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},Sy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(mt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},Ay={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},Ly={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},Ny={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(mt.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_mSecond,"period"],[mt.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Dy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_REF_VOLTAGE+mt.Msg.MIXLY_STAT).appendField(new mt.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},fy={init:function(){this.setColour(gy),this.appendValueInput("pin").appendField(mt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(mt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},Fy={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MODE).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[mt.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[mt.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(mt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Py={init:function(){this.setColour(20),this.appendDummyInput().appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(mt.Msg.MIXLY_MICROPYTHON_AS).appendField(new mt.FieldDropdown([[mt.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[mt.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[mt.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[mt.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},vy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("dac#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+mt.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Yy={init:function(){this.setColour(gy),this.appendDummyInput("").appendField(mt.Msg.MIXLY_SETUP).appendField(new mt.FieldTextInput("tc#"),"PIN_OBJ").appendField(mt.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(mt.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(mt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){mt.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Xy={init:function(){this.setColour(gy),this.appendValueInput("PIN",Number).appendField("PWM"+mt.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(mt.Msg.MIXLY_FREQUENCY+mt.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(mt.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},xy=Py,yy=Yy,by=fy,Vy=Fy,By=230,Gy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital),"PIN"),this.setOutput(!0)}},Uy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},wy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},ky={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},Hy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},Wy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},Ky={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},Jy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},qy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Qy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},zy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},jy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Zy={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},$y={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},tb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},eb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},ib={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog),"PIN"),this.setOutput(!0)}},nb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},sb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac),"PIN"),this.setOutput(!0)}},_b={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},ob={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},pb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm),"PIN"),this.setOutput(!0)}},ub={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.touch),"PIN"),this.setOutput(!0)}},db={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},Ib={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Tb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},hb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.imglist),"PIN"),this.setOutput(!0)}},Mb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist),"PIN"),this.setOutput(!0)}},mb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},Eb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},cb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},gb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Cb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Sb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Ab={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Lb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Nb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Db={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.one_more),"PIN"),this.setOutput(!0)}},fb={init:function(){this.setColour(By),this.appendDummyInput("").appendField(new mt.FieldDropdown(Et.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},Fb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},Pb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},vb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Yb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},Xb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},xb=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},yb=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},bb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},Vb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},Bb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},Gb=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,mt.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},Ub=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},wb=Ub,kb=Ub,Hb=Ub,Wb=Ub,Kb=Ub,Jb=Ub,qb=Ub,Qb=Ub,zb=Ub,jb=Ub,Zb=Ub,$b=Ub,tV=Ub,eV=Ub,iV=Ub,nV=Ub,sV=Ub,_V=Ub,oV=Ub,pV=Ub,aV=Ub,uV=Ub,rV=Ub,lV=Ub,dV=Ub,IV=Ub,TV=Ub,hV=Ub,MV=Ub,mV=Ub,EV=Ub,OV=Ub,RV=Ub,cV=Ub,gV=Ub,CV=Ub,SV=Ub,AV=Ub,LV=Ub,NV=Ub,DV=Ub,fV=Ub,FV=Ub,PV=Ub;Object.assign(mt.Variables,Rt),Object.assign(mt.Procedures,$n),mt.Python=cu,mt.generator=cu,Et.Profile.default={},Object.assign(Et.Profile,cy),Object.assign(Et.Profile.default,cy["MixGo CE"]),Object.assign(mt.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,V,W,H,X,B,K,f,k,w,U,G,F,D,N,y,x,b,P,v,Y,It,Tt),Object.assign(mt.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,st,lt,rt,tt,_t,dt,Q,ut,at,pt,ot,z,q,J,it,et,nt,j,Z,$,ht,Mt)})(); \ No newline at end of file diff --git a/boards/default/micropython_esp32s3/main.bundle.js b/boards/default/micropython_esp32s3/main.bundle.js index 728fb5dd..be98c839 100644 --- a/boards/default/micropython_esp32s3/main.bundle.js +++ b/boards/default/micropython_esp32s3/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Ot{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ht.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ht.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ht.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ht.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Vt={init:function(){this.setColour(vt),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.PYTHON_RANGE).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Bt={init:function(){this.setColour(vt),this.appendValueInput("LIST").setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ht.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ht.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gt={init:function(){this.setColour(vt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ht.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ht.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ht.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ht.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Ut={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ht.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},wt={init:function(){this.setColour(vt);var t=new ht.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ht.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ht.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},kt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ht.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ht.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ht={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ht.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ht.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Gt.OPERATORS=[[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],wt.OPERATORS=[[ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Wt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Kt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ht.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(vt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},qt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},zt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},jt={init:function(){this.jsonInit({message0:ht.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:vt,tooltip:ht.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ht.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Zt={init:function(){this.setColour(vt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_STAT),this.setOutput(!0)}},$t={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},te={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ee={init:function(){this.appendDummyInput().appendField(ht.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ht.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ht.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ht.FieldDropdown([[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(vt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},ie={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ne={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},se={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},_e={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_GET_UNIQUE_IDEN)}},oe={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ht.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},pe=230;ht.FieldTextInput.math_number_validator=function(t){return String(t)},ht.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const ae={init:function(){this.setColour(pe),this.appendDummyInput().appendField(new ht.FieldTextInput("0",ht.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MATH_NUMBER_TOOLTIP)}},ue={init:function(){this.setColour(pe);this.appendDummyInput("").appendField(ht.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ht.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},re={init:function(){this.setColour(pe);this.appendDummyInput("").appendField(ht.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ht.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},le={init:function(){this.setColour(pe),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ht.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ht.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ht.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},de={init:function(){this.setColour(pe),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ht.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ht.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ht.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ie={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ht.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Te={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ht.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ht.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ht.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ht.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ht.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ht.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ht.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ht.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},he={init:function(){var t=[[ht.Msg.MATH_BIN,"bin"],[ht.Msg.MATH_OCT,"oct"],[ht.Msg.MATH_HEX,"hex"]];this.setColour(pe),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ht.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ht.Msg.MATH_DEC_TOOLTIP_BIN,oct:ht.Msg.MATH_DEC_TOOLTIP_OCT,hex:ht.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Me={init:function(){var t=[[ht.Msg.LANG_MATH_TO_ROUND,"round"],[ht.Msg.LANG_MATH_TO_CEIL,"ceil"],[ht.Msg.LANG_MATH_TO_FLOOR,"floor"],[ht.Msg.MATH_ABS,"fabs"],[ht.Msg.MATH_SQRT,"sqrt"]];this.setColour(pe),this.appendValueInput("A").setCheck(Number).appendField(new ht.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ht.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ht.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ht.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ht.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ht.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ht.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},me={init:function(){var t=[[ht.Msg.MIXLY_MAX,"max"],[ht.Msg.MIXLY_MIN,"min"]];this.setColour(pe),this.appendValueInput("A").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ht.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ht.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ht.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ee={init:function(){var t=[[ht.Msg.MATH_TWO,"two"],[ht.Msg.MATH_EIGHT,"eight"],[ht.Msg.MATH_TEN,"ten"],[ht.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(pe),this.appendDummyInput("").appendField(ht.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ht.FieldDropdown(t),"OP").appendField(ht.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MATH_ZHW).appendField(new ht.FieldDropdown(t),"OP2").appendField(ht.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:ht.Msg.MATH_Before_two,eight:ht.Msg.MATH_Before_eight,ten:ht.Msg.MATH_Before_ten,sixteen:ht.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:ht.Msg.MATH_Behind_two,eight:ht.Msg.MATH_Behind_eight,ten:ht.Msg.MATH_Behind_ten,sixteen:ht.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Oe={init:function(){var t=[[ht.Msg.LANG_MATH_INT,"int"],[ht.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(pe),this.setOutput(!0,Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ht.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:ht.Msg.LANG_MATH_INT,float:ht.Msg.LANG_MATH_FLOAT_RANDOM};return ht.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Re={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ht.Msg.MATH_CONSTRAIN_TOOLTIP)}},ce={init:function(){this.setColour(pe),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ht.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ht.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_MATH_MAP)}},ge={init:function(){this.setColour(pe),this.appendDummyInput().appendField(new ht.FieldTextInput("0",ht.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ht.Msg.MATH_NUMBER_TOOLTIP)}},Ce={init:function(){this.setColour(pe),this.appendValueInput("NUM").setCheck(Number).appendField(ht.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Se={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MATH_ROUND).appendField(ht.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ht.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ht.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ae={init:function(){var t=[[ht.Msg.MIXLY_TO_INT,"int"],[ht.Msg.MIXLY_TO_FLOAT,"float"],[ht.Msg.MIXLY_TO_BITES,"b"],[ht.Msg.LANG_MATH_BYTE+ht.Msg.MIXLY_TO_INT,"bti"]];this.setColour(pe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ht.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ht.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ht.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Le={init:function(){var t=[[ht.Msg.MIXLY_TO_INT,"int"],[ht.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(pe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ht.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ht.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Ne=ce,De={init:function(){this.setColour(pe),this.appendValueInput("VAR").appendField(ht.Msg.LANG_MATH_BYTE+ht.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},fe={init:function(){this.setColour(pe),this.itemCount_=1,this.setMutator(new ht.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ht.Msg.MIXLY_PRODUCT+ht.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ht.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ht.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ht.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ye={init:function(){this.setColour(Fe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ht.FieldTextInput("",ht.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ht.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ht.FieldImage(e,7,12,'"')}},Xe={init:function(){this.setColour(Fe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ht.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},xe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},be={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(String).appendField(ht.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ye={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ve={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Be={init:function(){this.WHERE_OPTIONS=[[ht.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ht.Msg.TEXT_GET_INDEX_RANDOM+1+ht.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.LISTS_GET_INDEX_GET,"MODE"),ht.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ht.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+ht.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ht.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:ht.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ht.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ht.Msg.TEXT_GET_INDEX_RANDOM};return ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+ht.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ht.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ht.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ht.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ht.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ht.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ge={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ht.Msg.LISTS_GET_INDEX_GET+" "+ht.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ht.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+ht.Msg.LISTS_GET_INDEX_FROM_START+"n"+ht.Msg.TEXT_CHARAT2)}},Ue={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ht.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ht.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},we={init:function(){this.WHERE_OPTIONS_1=[[ht.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ht.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ht.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ht.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ht.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ht.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==ht.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ht.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ht.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new ht.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ke={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ht.Msg.LISTS_GET_INDEX_GET+" "+ht.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ht.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ht.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ht.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},He={init:function(){var t=[[ht.Msg.MIXLY_EQUALS,"==="],[ht.Msg.MIXLY_STARTSWITH,"startswith"],[ht.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Fe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ht.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},We={init:function(){this.setColour(Fe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ht.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_COMPARETO_HELP)}},Ke={init:function(){var t=[[ht.Msg.TEXT_UPPER,"upper"],[ht.Msg.TEXT_TITLE,"title"],[ht.Msg.TEXT_CAPITALIZE,"capitalize"],[ht.Msg.TEXT_SWAPCASE,"swapcase"],[ht.Msg.TEXT_LOWER,"lower"]];this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ht.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ht.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ht.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ht.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ht.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ht.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Je={init:function(){var t=[[ht.Msg.TEXT_LJUST,"ljust"],[ht.Msg.TEXT_CENTER,"center"],[ht.Msg.TEXT_RJUST,"rjust"]];this.setColour(Fe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ht.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ht.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Qe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ht.Msg.MIXLY_MID+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ht.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},qe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ze={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ht.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ht.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},je={init:function(){this.setColour(Fe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ht.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ht.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ze={init:function(){var t=[[ht.Msg.TEXT_TRIM_BOTH,"strip"],[ht.Msg.TEXT_TRIM_LEFT,"lstrip"],[ht.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Fe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ht.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ht.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ht.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ht.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ht.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},$e={init:function(){this.setColour(Fe),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ht.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ht.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qi={init:function(){this.setColour(Ki),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qi={init:function(){this.setColour(Ki),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zi={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_KEYS),this.setTooltip(ht.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},ji={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ht.Msg.DICTS_GET_TOOLTIP)}},Zi={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ht.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ht.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},$i={init:function(){this.setColour(Ki),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ht.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},tn={init:function(){this.setColour(Ki),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_DELETE_TOOLTIP)}},en={init:function(){this.setColour(Ki),this.appendValueInput("DICT2").setCheck("Dict").appendField(ht.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ht.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MID),this.setTooltip(ht.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_CLEAR),this.setTooltip(ht.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_ITEMS),this.setTooltip(ht.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},_n={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_VALUES),this.setTooltip(ht.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},on={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_LENGTH),this.setTooltip(ht.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},pn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_DELDICT),this.setTooltip(ht.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.MODE=[[ht.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ht.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ht.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ht.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ht.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ht.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ht.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},un={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.setTooltip(ht.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},rn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ht.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ln={init:function(){this.setColour(Ki),this.appendDummyInput("").appendField(new ht.FieldLabel(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ht.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},dn={init:function(){this.setColour(Ki),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},In={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TO_JSON),this.setTooltip(ht.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Tn={init:function(){this.setColour(Ki),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ht.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},hn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn=210,mn={init:function(){var t=ht.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ht.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ht.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ht.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ht.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ht.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ht.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},En={init:function(){var t=ht.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ht.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ht.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},On={init:function(){var t=[[ht.Msg.LOGIC_OPERATION_AND,"AND"],[ht.Msg.LOGIC_OPERATION_OR,"OR"],[ht.Msg.LOGIC_OPERATION_NOR,"NOR"],[ht.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ht.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ht.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ht.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ht.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ht.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Rn={init:function(){this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ht.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ht.Msg.LOGIC_NEGATE_TOOLTIP)}},cn={init:function(){var t=[[ht.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ht.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ht.FieldDropdown(t),"BOOL"),this.setTooltip(ht.Msg.LOGIC_BOOLEAN_TOOLTIP)}},gn={init:function(){this.setColour(Mn),this.setOutput(!0),this.appendDummyInput().appendField(ht.Msg.LOGIC_NULL),this.setTooltip(ht.Msg.LOGIC_NULL_TOOLTIP)}},Cn={init:function(){this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(ht.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ht.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Sn={init:function(){var t=[[ht.Msg.TEXT_APPEND_TO,"in"],[ht.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ht.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ht.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.IN)}},An={init:function(){var t=[[ht.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ht.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ln={init:function(){this.setColour(Mn),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Nn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ht.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG,o=ht.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ht.Msg.MIXPY_TEXT_ENCODE).appendField(new ht.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG,o=ht.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Pn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ht.Msg.MICROBIT_PYTHON_TYPE)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.HTML_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Vn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Bn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},kn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ht.Msg.MIXLY_ESP32_SET+{mkdir:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ht.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.HTML_FILE,"isfile"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Qn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ht.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ht.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},zn={};zn.NAME_TYPE=ht.PROCEDURE_CATEGORY_NAME,zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(ht.Msg.MIXLY_AIP_ATTR).setAlign(ht.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Ks={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_FORM_CONTENT).appendField(new ht.FieldDropdown([[ht.Msg.HTML_TEXT,"text"],[ht.Msg.HTML_EMAIL,"email"],[ht.Msg.HTML_NUMBER,"number"],[ht.Msg.HTML_PASSWORD,"password"],[ht.Msg.HTML_CHECKBOX,"checkbox"],[ht.Msg.HTML_RADIOBUTTON,"radiobutton"],[ht.Msg.HTML_BUTTON,"button"],[ht.Msg.HTML_COLOUR,"colour"],[ht.Msg.HTML_DATE,"date"],[ht.Msg.HTML_LOCALTIME,"local time"],[ht.Msg.HTML_FILE,"file"],[ht.Msg.HTML_HIDDEN,"hidden"],[ht.Msg.HTML_IMAGE,"image"],[ht.Msg.HTML_MONTH,"month"],[ht.Msg.HTML_RANGE,"range"],[ht.Msg.HTML_RESET,"reset"],[ht.Msg.HTML_SEARCH,"search"],[ht.Msg.HTML_SUBMIT,"submit"],[ht.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ht.Msg.HTML_TIME,"time"],[ht.Msg.HTML_URL,"url"],[ht.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ht.Msg.HTML_NAME).appendField(new ht.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ht.Msg.HTML_VALUE).appendField(new ht.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ht.Msg.MIXLY_AIP_ATTR).setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(new ht.FieldTextInput("property"),"KEY").appendField(":").appendField(new ht.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(new ht.FieldTextInput("property"),"KEY").appendField(":").appendField(new ht.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_TEXT).appendField(new ht.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs=160,js={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ht.FieldTable(""),"TEXT")}},Zs={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ht.FieldMultilineInput(""),"TEXT")}},$s={init:function(){this.setColour(zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ht.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},t_={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},e_={init:function(){this.setColour(zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ht.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},i_={init:function(){this.setColour(zs),this.appendValueInput("VALUE").appendField(ht.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},n_={init:function(){this.setColour(zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ht.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ht.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ht.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},ht.isNumber(n)&&ht.isNumber(s)&&ht.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const Jp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},Qp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},qp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},zp=function(t,e){return["None",e.ORDER_ATOMIC]},jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Zp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ta=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},ea=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},na=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},sa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},_a=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},oa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},pa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},aa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ua=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},la=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},da=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ha=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ma=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ma=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ea=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Oa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},ga=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),ht.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},su=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},_u=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},au=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},uu=function(t,e){return'"},ru=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},lu=function(){return this.getFieldValue("TEXT")+"\n"},du=function(t){return t.getFieldValue("TEXT")+"\n"},Iu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Tu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},hu=function(){return""},Mu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},mu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},Ou.scrubNakedValue=function(t){return t+"\n"},Ou.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Ou.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Ou.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=ht.utils.string.wrap(_,Ou.COMMENT_WRAP-3),n+=Ou.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Ru="#74A55B",cu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_RGB_PIN_COUNT)}},gu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Cu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Su={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Au={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ht.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ht.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Lu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Nu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_RESET)}},Du={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Fu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Pu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},vu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Yu={init:function(){this.setColour(Ru),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},xu={init:function(){this.setColour(Ru),this.appendValueInput("VAR").appendField("360°"+ht.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SETTING+ht.Msg.blockpy_turtle_rotate+ht.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},bu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},yu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Vu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Bu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Gu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new ht.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(ht.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},Uu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ht.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[ht.Msg.MOTOR_N,"ms32006.MOT_N"],[ht.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},wu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new ht.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ht.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},ku={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_RGB_PIN_COUNT)}},Hu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Wu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Ku={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_WRI)}},Ju={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new ht.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+ht.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Qu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},qu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},zu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(ht.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},ju={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(ht.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(ht.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Zu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},$u={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},tr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},er={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_TRAFFIC_LIGHT).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LISTS_SET_INDEX_SET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ir={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_WHITE,"W"],[ht.Msg.COLOUR_RGB_RED,"R"],[ht.Msg.COLOUR_RGB_YELLOW,"Y"],[ht.Msg.COLOUR_RGB_GREEN,"G"],[ht.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_WHITE,"W"],[ht.Msg.COLOUR_RGB_RED,"R"],[ht.Msg.COLOUR_RGB_YELLOW,"Y"],[ht.Msg.COLOUR_RGB_GREEN,"G"],[ht.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},sr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[ht.Msg.MIXLY_SPEED,"[1]"],[ht.Msg.MATH_SINGLE_OP_ABSOLUTE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[ht.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[ht.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[ht.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MATH_SINGLE_OP_ABSOLUTE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"0"],[ht.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[ht.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},ar={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField("("+ht.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField("("+ht.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"0"],[ht.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MOTOR,"ext_motor"],[ht.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ht.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ht.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ht.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ht.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ht.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ht.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},dr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MOTOR,"ext_motor"],[ht.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ht.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ht.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ht.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ht.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ht.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ht.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir="#6C9858",Tr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},hr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_ON,"1"],[ht.Msg.MIXLY_ESP32_OFF,"0"],[ht.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Mr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},mr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Er={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Or={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_BUILDIN_LED+ht.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Rr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(ht.Msg.MIXLY_LCD_SETCOLOR).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LIGHT_RED,"1"],[ht.Msg.MIXLY_LIGHT_GREEN,"2"],[ht.Msg.MIXLY_LIGHT_BLUE,"3"],[ht.Msg.MIXLY_LIGHT_YELLOW,"4"],[ht.Msg.MIXLY_LIGHT_CYAN,"5"],[ht.Msg.MIXLY_LIGHT_PURPLE,"6"],[ht.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},cr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},gr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Cr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Sr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_BUILDIN_LED+ht.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Ar={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Lr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Mt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Nr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Dr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},fr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.PYTHON_RANGE_STEP).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Fr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_WRI)}},Pr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Mt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},vr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Yr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.PYTHON_RANGE_STEP).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Xr={init:function(){this.setColour(Ir),this.appendValueInput("TICKS").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ht.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ht.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},xr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},br={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_RESET)}},yr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Vr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Br={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gr={init:function(){this.setColour(Ir),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Ur={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField("MixGo Car").appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},kr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField("MixGo Car").appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Hr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([[ht.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ht.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([[ht.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ht.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_STOP).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Jr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ht.Msg.MIXLY_SPEED,"SPEED"],[ht.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Qr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.MIXLY_MOTOR).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"1"],[ht.Msg.TEXT_TRIM_RIGHT,"2"],[ht.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ht.Msg.MIXLY_SPEED,"SPEED"],[ht.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[ht.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},jr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(ht.Msg.MIXLY_MOTOR).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"0"],[ht.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(Ir),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},el={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},il={init:function(){this.setColour(Ir),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_MIXBOT_BUZZER+ht.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MIXBOT_BUZZER+ht.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_RECORD_AUDIO).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(ht.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},_l={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_PLAY_AUDIO).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ol={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},al={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ul={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.LISTS_SET_INDEX_SET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},rl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT+ht.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},ll={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.LISTS_SET_INDEX_SET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.MIXLY_ALL+ht.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(ht.ALIGN_RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT+ht.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},dl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.ANALOG+ht.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(ht.Msg.MIXLY_RELEASE).appendField(new ht.FieldDropdown([[ht.Msg.MICROPYTHON_DISPLAY_YES,"True"],[ht.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.ANALOG+ht.Msg.MIXLY_KEYBOARD_INPUT)}},Il={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SPECIAL_KEY).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[ht.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[ht.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[ht.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[ht.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[ht.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[ht.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[ht.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[ht.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Tl={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GENERAL_KEY).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},hl={init:function(){this.setColour(Ir),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new ht.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(ht.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Sm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Am={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Lm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Nm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ht.Msg.MIXLY_WIFI_USERNAME).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ht.Msg.MIXLY_IOT_PASSWORD).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ht.Msg.MIXLY_EMQX_PROJECT).setAlign(ht.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ht.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ht.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},fm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ht.Msg.MIXLY_EMQX_SUBSCRIBE+ht.Msg.MIXLY_MICROBIT_MSG).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ht.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Fm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ym={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ht.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Xm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},xm={init:function(){this.setColour(mm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},bm={init:function(){this.setColour(mm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},ym={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Vm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO").appendField(ht.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ht.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Bm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+ht.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Um={init:function(){this.VISITOR_ID=Mt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(mm),this.appendDummyInput("").appendField(new ht.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},wm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO").appendField(ht.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},km={init:function(){this.setColour(mm),this.appendDummyInput().appendField("HTTP"+ht.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ht.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ht.Msg.MIXLY_REQUESTS_GET).appendField(ht.Msg.MIXLY_GET_CURRENT_TIME).appendField(ht.Msg.MIXLY_OPEN_DEBUG).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("HTTP"+ht.Msg.MIXLY_Client).appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ht.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ht.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Wm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MQTT"+ht.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ht.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ht.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ht.Msg.MQTT_Topic).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ht.Msg.MIXLY_OPEN_DEBUG).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Km={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MQTT"+ht.Msg.MIXLY_Client).appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ht.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ht.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Jm=Em,Qm=Om,qm=Rm,zm=cm,jm=Cm,Zm=225,$m={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(ht.Msg.MIXLY_NETWORK_MODE).appendField(new ht.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},tE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[ht.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=ht.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:ht.Msg.MIXLY_NETWORK_WIFI_OPEN,False:ht.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},eE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},iE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return ht.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:ht.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},nE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(ht.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(ht.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},sE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_CONNECT+ht.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},_E={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[ht.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[ht.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:ht.Msg.MIXLY_ESP32_NETWORK_IP,1:ht.Msg.MIXLY_ESP32_NETWORK_MASK,2:ht.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},oE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},pE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[ht.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},aE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(ht.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(ht.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},uE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},rE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new ht.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},lE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},dE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},IE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},TE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},hE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},ME={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},mE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},EE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},OE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},RE={init:function(){this.setColour(Zm),this.appendValueInput("DOMAIN").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_REQUESTS_GET).appendField(new ht.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},cE={init:function(){this.appendValueInput("VAL");var t=[[ht.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ht.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ht.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ht.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},gE={init:function(){this.appendValueInput("VAR").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ht.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ht.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ht.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},CE={init:function(){this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(ht.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},SE={init:function(){this.setColour(Zm),this.appendDummyInput("").appendField(new ht.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},AE="#3288dd",LE={init:function(){this.setColour(AE),this.appendValueInput("URL").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ht.Msg.blockpy_REQUESTS).appendField(ht.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},NE={init:function(){this.setColour(AE),this.appendValueInput("URL").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ht.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ht.Msg.blockpy_REQUESTS+ht.Msg.OLED_STRING),this.appendDummyInput("").appendField(ht.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},DE={init:function(){this.appendValueInput("VAL");var t=[[ht.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ht.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(AE),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},fE=100,FE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendDummyInput().appendField(t).appendField(ht.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},PE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendValueInput("PIN").appendField(t).appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},vE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendValueInput("PIN").appendField(t).appendField(ht.Msg.SET_USB),this.appendValueInput("percent").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_POWER_SUPPLY),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},YE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendDummyInput().appendField(t).appendField(ht.Msg.MIXLY_SPK_STATE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ON,"True"],[ht.Msg.MIXLY_OFF,"False"]]),"state"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},XE=100,xE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("I2CSUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},yE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},VE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},BE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},GE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},UE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+ht.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},wE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},kE="#A58C5B",HE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SENOR_IS_PRESSED)}},WE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SENOR_WAS_PRESSED)}},KE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_BUTTON+ht.Msg.MIXLY_GET_PRESSES)}},JE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ht.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ht.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},QE={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_shake,"shake"],[ht.Msg.MIXLY_UP,"up"],[ht.Msg.MIXLY_DOWN,"down"],[ht.Msg.MIXLY_LEFT,"left"],[ht.Msg.MIXLY_RIGHT,"right"],[ht.Msg.MIXLY_MICROBIT_face_up,"face up"],[ht.Msg.MIXLY_MICROBIT_face_down,"face down"],[ht.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ht.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ht.Msg.MSG.catSensor,s=ht.Msg.MIXLY_MICROBIT_JS_STATE,_=ht.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ht.Msg.MIXLY_MICROBIT_shake,up:ht.Msg.MIXLY_UP,down:ht.Msg.MIXLY_DOWN,left:ht.Msg.MIXLY_LEFT,right:ht.Msg.MIXLY_RIGHT,"face up":ht.Msg.MIXLY_MICROBIT_face_up,"face down":ht.Msg.MIXLY_MICROBIT_face_down,freefall:ht.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},qE={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},zE={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},jE={init:function(){var t=[[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(kE),this.appendValueInput("PIN",Number).appendField(new ht.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new ht.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},ZE={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},$E={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},tO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"left"],[ht.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(ht.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=ht.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=ht.Msg.MIXLY_ESP32_NEAR;return i+{left:ht.Msg.TEXT_TRIM_LEFT,right:ht.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},eO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[ht.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":ht.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":ht.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},iO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[ht.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},nO={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},sO={init:function(){this.setColour(kE),this.appendDummyInput("").appendField("LM35"+ht.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_LM35)}},_O={init:function(){this.setColour(kE),this.appendValueInput("I2CSUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ht.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},oO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[ht.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[ht.Msg.MIXLY_ESP32_MAX30102_IR+","+ht.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[ht.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[ht.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.HTML_COLOUR+ht.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET+ht.Msg.HTML_COLOUR,"[2]"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_IR_STRENGTH,"[1]"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},rO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.HTML_COLOUR+ht.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET+"RGB"+ht.Msg.HTML_COLOUR,"0"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_RGB_RAW,"1"],[ht.Msg.MIXLY_GET_ENV_LIGHT+ht.Msg.MIXLY_BRIGHTNESS,"2"],[ht.Msg.GET_IR_STRENGTH+ht.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},lO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET_ENV_LIGHT,"E"],[ht.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},dO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},IO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},TO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},hO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_Altitude+ht.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETPRESSURE,"pressure()"],[ht.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ht.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},MO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_Altitude+ht.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETPRESSURE,"pressure()"],[ht.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ht.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},mO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MIXGOPE_FIELD+ht.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[ht.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_shake,"shake"],[ht.Msg.MIXLY_UP,"up"],[ht.Msg.MIXLY_DOWN,"down"],[ht.Msg.MIXLY_LEFT,"left"],[ht.Msg.MIXLY_RIGHT,"right"],[ht.Msg.MIXLY_MICROBIT_face_up,"face up"],[ht.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ht.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ht.Msg.MSG.catSensor,s=ht.Msg.MIXLY_MICROBIT_JS_STATE,_=ht.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ht.Msg.MIXLY_MICROBIT_shake,up:ht.Msg.MIXLY_UP,down:ht.Msg.MIXLY_DOWN,left:ht.Msg.MIXLY_LEFT,right:ht.Msg.MIXLY_RIGHT,"face up":ht.Msg.MIXLY_MICROBIT_face_up,"face down":ht.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},OO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},RO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_GET+ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},cO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+ht.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},gO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},CO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_GETTEMPERATUE)}},SO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return ht.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},AO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},LO={init:function(){this.setColour(kE),this.appendValueInput("SPISUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ht.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},NO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[ht.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},fO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},FO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ht.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},PO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ht.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(ht.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},vO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RFID_SCAN_OK,"0"],[ht.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[ht.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},YO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},XO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},xO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ht.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},CN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},SN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},AN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},LN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},NN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},DN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},fN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},FN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},PN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},vN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},YN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},XN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},xN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},bN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},yN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},VN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},BN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},GN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},UN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},wN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},kN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},HN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},WN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},KN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},JN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},QN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},qN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},zN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},jN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},ZN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},$N=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},tD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},eD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},iD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Mt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},nD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},sD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},_D=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},oD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},pD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},aD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},uD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},rD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},lD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},dD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},TD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},hD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Mt.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},MD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},mD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},ED=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},OD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},RD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},cD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},gD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},CD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},SD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},AD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},LD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},ND=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},DD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},fD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},FD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},PD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},vD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},YD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},XD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},xD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},bD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},yD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},VD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},BD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Ef=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},Of=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Rf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},cf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},gf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},Cf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},Sf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},Af=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},Lf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},Nf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},Df=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},ff=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},Ff=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},Pf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},vf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},Yf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Xf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},xf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},bf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},yf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},Vf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Bf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Gf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},Uf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},wf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},qX=function(){return"control.reset()\n"},zX=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},jX=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},ZX=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},$X=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},tx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},ex=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},ix=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},nx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},sx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},_x=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},ox=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},px=function(){return"while True:\n pass\n"},ax=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},ux=function(t,e){return e.definitions_.import_os="import os","os.uname()"},rx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},lx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},dx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Ix=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Tx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},hx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},Mx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},mx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},Ex=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},Ox=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Rx=hx,cx=Ix,gx=Tx,Cx=rx,Sx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ax=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Lx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Nx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},Dx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},fx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Fx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Px=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},vx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Yx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Xx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},xx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},bx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},yx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Vx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Bx={};Bx["元控青春"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","spk_midi.DADADADUM"],["ENTERTAINER","spk_midi.ENTERTAINER"],["PRELUDE","spk_midi.PRELUDE"],["ODE","spk_midi.ODE"],["NYAN","spk_midi.NYAN"],["RINGTONE","spk_midi.RINGTONE"],["FUNK","spk_midi.FUNK"],["BLUES","spk_midi.BLUES"],["BIRTHDAY","spk_midi.BIRTHDAY"],["WEDDING","spk_midi.WEDDING"],["FUNERAL","spk_midi.FUNERAL"],["PUNCHLINE","spk_midi.PUNCHLINE"],["PYTHON","spk_midi.PYTHON"],["BADDY","spk_midi.BADDY"],["CHASE","spk_midi.CHASE"],["BA_DING","spk_midi.BA_DING"],["WAWAWAWAA","spk_midi.WAWAWAWAA"],["JUMP_UP","spk_midi.JUMP_UP"],["JUMP_DOWN","spk_midi.JUMP_DOWN"],["POWER_UP","spk_midi.POWER_UP"],["POWER_DOWN","spk_midi.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Bx["元控"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","spk_midi.DADADADUM"],["ENTERTAINER","spk_midi.ENTERTAINER"],["PRELUDE","spk_midi.PRELUDE"],["ODE","spk_midi.ODE"],["NYAN","spk_midi.NYAN"],["RINGTONE","spk_midi.RINGTONE"],["FUNK","spk_midi.FUNK"],["BLUES","spk_midi.BLUES"],["BIRTHDAY","spk_midi.BIRTHDAY"],["WEDDING","spk_midi.WEDDING"],["FUNERAL","spk_midi.FUNERAL"],["PUNCHLINE","spk_midi.PUNCHLINE"],["PYTHON","spk_midi.PYTHON"],["BADDY","spk_midi.BADDY"],["CHASE","spk_midi.CHASE"],["BA_DING","spk_midi.BA_DING"],["WAWAWAWAA","spk_midi.WAWAWAWAA"],["JUMP_UP","spk_midi.JUMP_UP"],["JUMP_DOWN","spk_midi.JUMP_DOWN"],["POWER_UP","spk_midi.POWER_UP"],["POWER_DOWN","spk_midi.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Bx["ESP32S2 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM",".DADADADUM"],["ENTERTAINER",".ENTERTAINER"],["PRELUDE",".PRELUDE"],["ODE",".ODE"],["NYAN",".NYAN"],["RINGTONE",".RINGTONE"],["FUNK",".FUNK"],["BLUES",".BLUES"],["BIRTHDAY",".BIRTHDAY"],["WEDDING",".WEDDING"],["FUNERAL",".FUNERAL"],["PUNCHLINE",".PUNCHLINE"],["PYTHON",".PYTHON"],["BADDY",".BADDY"],["CHASE",".CHASE"],["BA_DING",".BA_DING"],["WAWAWAWAA",".WAWAWAWAA"],["JUMP_UP",".JUMP_UP"],["JUMP_DOWN",".JUMP_DOWN"],["POWER_UP",".POWER_UP"],["POWER_DOWN",".POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const Gx=Bx,Ux=20,wx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_HIGH,"HIGH"],[ht.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},kx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},Hx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},Wx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField("DAC"+ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},Kx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_mSecond,"period"],[ht.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Jx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_REF_VOLTAGE+ht.Msg.MIXLY_STAT).appendField(new ht.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},Qx={init:function(){this.setColour(Ux),this.appendValueInput("pin").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},qx={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ht.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ht.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},zx={init:function(){this.setColour(20),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_AS).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[ht.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[ht.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[ht.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},jx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("dac#"),"PIN_OBJ").appendField(ht.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+ht.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Zx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("tc#"),"PIN_OBJ").appendField(ht.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},$x={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField("PWM"+ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_FREQUENCY+ht.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},tb=zx,eb=Zx,ib=Qx,nb=qx,sb=230,_b={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital),"PIN"),this.setOutput(!0)}},ob={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},pb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},ub={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},db={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Ib={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Tb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},hb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Eb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},cb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog),"PIN"),this.setOutput(!0)}},gb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},Cb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.dac),"PIN"),this.setOutput(!0)}},Sb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Ab={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},Lb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},Nb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},Db={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},fb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},Fb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.touch),"PIN"),this.setOutput(!0)}},Pb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},vb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Yb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},Xb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},xb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},bb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},yb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},Vb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Bb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Gb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Ub={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},wb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},kb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Hb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Wb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Kb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Jb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},Qb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},qb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},zb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},jb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Zb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},$b=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},ty=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},ey=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},iy=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},ny=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},sy=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},_y=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},oy=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},py=oy,ay=oy,uy=oy,ry=oy,ly=oy,dy=oy,Iy=oy,Ty=oy,hy=oy,My=oy,my=oy,Ey=oy,Oy=oy,Ry=oy,cy=oy,gy=oy,Cy=oy,Sy=oy,Ay=oy,Ly=oy,Ny=oy,Dy=oy,fy=oy,Fy=oy,Py=oy,vy=oy,Yy=oy,Xy=oy,xy=oy,by=oy,yy=oy,Vy=oy,By=oy,Gy=oy,Uy=oy,wy=oy,ky=oy,Hy=oy,Wy=oy,Ky=oy,Jy=oy,Qy=oy,qy=oy,zy=oy;Object.assign(ht.Variables,Et),Object.assign(ht.Procedures,jn),ht.Python=Ou,ht.generator=Ou,Mt.Profile.default={},Object.assign(Mt.Profile,Gx),Object.assign(Mt.Profile.default,Gx["MixGo CE"]),Object.assign(ht.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,b,H,k,v,y,W,f,w,U,G,V,F,D,N,X,Y,x,P,B,lt,dt),Object.assign(ht.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,et,ut,at,j,it,rt,Q,pt,ot,_t,nt,q,J,K,$,Z,tt,z,st,It,Tt)})(); \ No newline at end of file +class Ot{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ht.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ht.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_if_else");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ht.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ht.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Vt={init:function(){this.setColour(vt),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.PYTHON_RANGE).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Bt={init:function(){this.setColour(vt),this.appendValueInput("LIST").setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ht.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ht.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gt={init:function(){this.setColour(vt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ht.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ht.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ht.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ht.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Ut={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ht.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var _=t.newBlock("controls_finally");_.initSvg(),i.connect(_.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],_=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,_=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,_)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),_=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(_.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ht.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},wt={init:function(){this.setColour(vt);var t=new ht.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ht.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ht.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},kt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ht.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ht.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ht={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ht.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ht.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Gt.OPERATORS=[[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],wt.OPERATORS=[[ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ht.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Wt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Kt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ht.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Qt={init:function(){this.setColour(vt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},qt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},zt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ht.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},jt={init:function(){this.jsonInit({message0:ht.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:vt,tooltip:ht.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ht.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Zt={init:function(){this.setColour(vt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_STAT),this.setOutput(!0)}},$t={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},te={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},ee={init:function(){this.appendDummyInput().appendField(ht.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ht.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ht.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ht.FieldDropdown([[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ht.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(vt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},ie={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ne={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},se={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},_e={init:function(){this.setColour(vt),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_GET_UNIQUE_IDEN)}},oe={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ht.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},pe=230;ht.FieldTextInput.math_number_validator=function(t){return String(t)},ht.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const ae={init:function(){this.setColour(pe),this.appendDummyInput().appendField(new ht.FieldTextInput("0",ht.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MATH_NUMBER_TOOLTIP)}},ue={init:function(){this.setColour(pe);this.appendDummyInput("").appendField(ht.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ht.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},re={init:function(){this.setColour(pe);this.appendDummyInput("").appendField(ht.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ht.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ht.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},le={init:function(){this.setColour(pe),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ht.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ht.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ht.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},de={init:function(){this.setColour(pe),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ht.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ht.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ht.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ht.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ht.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ie={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ht.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Te={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ht.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ht.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ht.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ht.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ht.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ht.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ht.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ht.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},he={init:function(){var t=[[ht.Msg.MATH_BIN,"bin"],[ht.Msg.MATH_OCT,"oct"],[ht.Msg.MATH_HEX,"hex"]];this.setColour(pe),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ht.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ht.Msg.MATH_DEC_TOOLTIP_BIN,oct:ht.Msg.MATH_DEC_TOOLTIP_OCT,hex:ht.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Me={init:function(){var t=[[ht.Msg.LANG_MATH_TO_ROUND,"round"],[ht.Msg.LANG_MATH_TO_CEIL,"ceil"],[ht.Msg.LANG_MATH_TO_FLOOR,"floor"],[ht.Msg.MATH_ABS,"fabs"],[ht.Msg.MATH_SQRT,"sqrt"]];this.setColour(pe),this.appendValueInput("A").setCheck(Number).appendField(new ht.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ht.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ht.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ht.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ht.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ht.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ht.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},me={init:function(){var t=[[ht.Msg.MIXLY_MAX,"max"],[ht.Msg.MIXLY_MIN,"min"]];this.setColour(pe),this.appendValueInput("A").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ht.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ht.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ht.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ee={init:function(){var t=[[ht.Msg.MATH_TWO,"two"],[ht.Msg.MATH_EIGHT,"eight"],[ht.Msg.MATH_TEN,"ten"],[ht.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(pe),this.appendDummyInput("").appendField(ht.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ht.FieldDropdown(t),"OP").appendField(ht.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MATH_ZHW).appendField(new ht.FieldDropdown(t),"OP2").appendField(ht.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:ht.Msg.MATH_Before_two,eight:ht.Msg.MATH_Before_eight,ten:ht.Msg.MATH_Before_ten,sixteen:ht.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:ht.Msg.MATH_Behind_two,eight:ht.Msg.MATH_Behind_eight,ten:ht.Msg.MATH_Behind_ten,sixteen:ht.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Oe={init:function(){var t=[[ht.Msg.LANG_MATH_INT,"int"],[ht.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(pe),this.setOutput(!0,Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ht.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ht.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:ht.Msg.LANG_MATH_INT,float:ht.Msg.LANG_MATH_FLOAT_RANDOM};return ht.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Re={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ht.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ht.Msg.MATH_CONSTRAIN_TOOLTIP)}},ce={init:function(){this.setColour(pe),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ht.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ht.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_MATH_MAP)}},ge={init:function(){this.setColour(pe),this.appendDummyInput().appendField(new ht.FieldTextInput("0",ht.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ht.Msg.MATH_NUMBER_TOOLTIP)}},Ce={init:function(){this.setColour(pe),this.appendValueInput("NUM").setCheck(Number).appendField(ht.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Se={init:function(){this.setColour(pe),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MATH_ROUND).appendField(ht.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ht.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ht.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ae={init:function(){var t=[[ht.Msg.MIXLY_TO_INT,"int"],[ht.Msg.MIXLY_TO_FLOAT,"float"],[ht.Msg.MIXLY_TO_BITES,"b"],[ht.Msg.LANG_MATH_BYTE+ht.Msg.MIXLY_TO_INT,"bti"]];this.setColour(pe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ht.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ht.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ht.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Le={init:function(){var t=[[ht.Msg.MIXLY_TO_INT,"int"],[ht.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(pe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ht.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ht.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Ne=ce,De={init:function(){this.setColour(pe),this.appendValueInput("VAR").appendField(ht.Msg.LANG_MATH_BYTE+ht.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},fe={init:function(){this.setColour(pe),this.itemCount_=1,this.setMutator(new ht.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ht.Msg.MIXLY_PRODUCT+ht.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ht.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ht.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ht.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ye={init:function(){this.setColour(Fe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ht.FieldTextInput("",ht.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ht.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ht.FieldImage(e,7,12,'"')}},Xe={init:function(){this.setColour(Fe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ht.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},xe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},be={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(String).appendField(ht.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ye={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ve={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Be={init:function(){this.WHERE_OPTIONS=[[ht.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ht.Msg.TEXT_GET_INDEX_RANDOM+1+ht.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.LISTS_GET_INDEX_GET,"MODE"),ht.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ht.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=ht.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+ht.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ht.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:ht.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ht.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ht.Msg.TEXT_GET_INDEX_RANDOM};return ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+ht.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ht.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ht.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ht.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ht.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ht.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ge={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ht.Msg.LISTS_GET_INDEX_GET+" "+ht.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ht.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+ht.Msg.LISTS_GET_INDEX_FROM_START+"n"+ht.Msg.TEXT_CHARAT2)}},Ue={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ht.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ht.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},we={init:function(){this.WHERE_OPTIONS_1=[[ht.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ht.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ht.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ht.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ht.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ht.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ht.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==ht.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ht.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ht.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new ht.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ke={init:function(){this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ht.Msg.LISTS_GET_INDEX_GET+" "+ht.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ht.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ht.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ht.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},He={init:function(){var t=[[ht.Msg.MIXLY_EQUALS,"==="],[ht.Msg.MIXLY_STARTSWITH,"startswith"],[ht.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Fe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ht.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},We={init:function(){this.setColour(Fe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ht.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_COMPARETO_HELP)}},Ke={init:function(){var t=[[ht.Msg.TEXT_UPPER,"upper"],[ht.Msg.TEXT_TITLE,"title"],[ht.Msg.TEXT_CAPITALIZE,"capitalize"],[ht.Msg.TEXT_SWAPCASE,"swapcase"],[ht.Msg.TEXT_LOWER,"lower"]];this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ht.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ht.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ht.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ht.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ht.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ht.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Je={init:function(){var t=[[ht.Msg.TEXT_LJUST,"ljust"],[ht.Msg.TEXT_CENTER,"center"],[ht.Msg.TEXT_RJUST,"rjust"]];this.setColour(Fe),this.appendValueInput("VAR").appendField(new ht.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ht.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ht.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Qe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ht.Msg.MIXLY_MID+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ht.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},qe={init:function(){this.setColour(Fe),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ze={init:function(){this.setColour(Fe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ht.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ht.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},je={init:function(){this.setColour(Fe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ht.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ht.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ze={init:function(){var t=[[ht.Msg.TEXT_TRIM_BOTH,"strip"],[ht.Msg.TEXT_TRIM_LEFT,"lstrip"],[ht.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Fe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ht.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ht.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ht.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ht.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ht.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ht.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},$e={init:function(){this.setColour(Fe),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ht.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ht.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qi={init:function(){this.setColour(Ki),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qi={init:function(){this.setColour(Ki),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zi={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_KEYS),this.setTooltip(ht.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},ji={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ht.Msg.DICTS_GET_TOOLTIP)}},Zi={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ht.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ht.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},$i={init:function(){this.setColour(Ki),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ht.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},tn={init:function(){this.setColour(Ki),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ht.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_DELETE_TOOLTIP)}},en={init:function(){this.setColour(Ki),this.appendValueInput("DICT2").setCheck("Dict").appendField(ht.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ht.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MID),this.setTooltip(ht.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_CLEAR),this.setTooltip(ht.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_ITEMS),this.setTooltip(ht.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},_n={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_VALUES),this.setTooltip(ht.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},on={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_LENGTH),this.setTooltip(ht.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},pn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.DICT_DELDICT),this.setTooltip(ht.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.MODE=[[ht.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ht.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ht.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ht.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ht.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ht.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ht.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ht.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},un={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ht.Msg.DICTS_ADD_VALUE),this.setTooltip(ht.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},rn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ht.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ht.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ln={init:function(){this.setColour(Ki),this.appendDummyInput("").appendField(new ht.FieldLabel(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ht.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},dn={init:function(){this.setColour(Ki),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},In={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TO_JSON),this.setTooltip(ht.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Tn={init:function(){this.setColour(Ki),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ht.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},hn={init:function(){this.setColour(Ki),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn=210,mn={init:function(){var t=ht.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ht.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ht.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ht.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ht.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ht.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ht.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},En={init:function(){var t=ht.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ht.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ht.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},On={init:function(){var t=[[ht.Msg.LOGIC_OPERATION_AND,"AND"],[ht.Msg.LOGIC_OPERATION_OR,"OR"],[ht.Msg.LOGIC_OPERATION_NOR,"NOR"],[ht.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ht.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ht.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ht.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ht.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ht.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Rn={init:function(){this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ht.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ht.Msg.LOGIC_NEGATE_TOOLTIP)}},cn={init:function(){var t=[[ht.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ht.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ht.FieldDropdown(t),"BOOL"),this.setTooltip(ht.Msg.LOGIC_BOOLEAN_TOOLTIP)}},gn={init:function(){this.setColour(Mn),this.setOutput(!0),this.appendDummyInput().appendField(ht.Msg.LOGIC_NULL),this.setTooltip(ht.Msg.LOGIC_NULL_TOOLTIP)}},Cn={init:function(){this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(ht.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ht.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Sn={init:function(){var t=[[ht.Msg.TEXT_APPEND_TO,"in"],[ht.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ht.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ht.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.IN)}},An={init:function(){var t=[[ht.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ht.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ht.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ln={init:function(){this.setColour(Mn),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Nn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ht.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG,o=ht.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ht.Msg.MIXPY_TEXT_ENCODE).appendField(new ht.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_USE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,_=ht.Msg.MIXLY_BELONG,o=ht.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+_+n+s+o}))}},Pn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ht.Msg.MIXLY_MICROBIT_TYPE_STRING+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Yn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ht.Msg.MICROBIT_PYTHON_TYPE)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.HTML_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},yn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Vn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Bn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},kn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ht.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ht.Msg.MIXLY_ESP32_SET+{mkdir:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ht.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.HTML_FILE,"isfile"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ht.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Qn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ht.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ht.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},zn={};zn.NAME_TYPE=ht.PROCEDURE_CATEGORY_NAME,zn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(ht.Msg.MIXLY_AIP_ATTR).setAlign(ht.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Ks={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_FORM_CONTENT).appendField(new ht.FieldDropdown([[ht.Msg.HTML_TEXT,"text"],[ht.Msg.HTML_EMAIL,"email"],[ht.Msg.HTML_NUMBER,"number"],[ht.Msg.HTML_PASSWORD,"password"],[ht.Msg.HTML_CHECKBOX,"checkbox"],[ht.Msg.HTML_RADIOBUTTON,"radiobutton"],[ht.Msg.HTML_BUTTON,"button"],[ht.Msg.HTML_COLOUR,"colour"],[ht.Msg.HTML_DATE,"date"],[ht.Msg.HTML_LOCALTIME,"local time"],[ht.Msg.HTML_FILE,"file"],[ht.Msg.HTML_HIDDEN,"hidden"],[ht.Msg.HTML_IMAGE,"image"],[ht.Msg.HTML_MONTH,"month"],[ht.Msg.HTML_RANGE,"range"],[ht.Msg.HTML_RESET,"reset"],[ht.Msg.HTML_SEARCH,"search"],[ht.Msg.HTML_SUBMIT,"submit"],[ht.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ht.Msg.HTML_TIME,"time"],[ht.Msg.HTML_URL,"url"],[ht.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ht.Msg.HTML_NAME).appendField(new ht.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ht.Msg.HTML_VALUE).appendField(new ht.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ht.Msg.MIXLY_AIP_ATTR).setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Js={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(new ht.FieldTextInput("property"),"KEY").appendField(":").appendField(new ht.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(new ht.FieldTextInput("property"),"KEY").appendField(":").appendField(new ht.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Bs),this.appendDummyInput().appendField(ht.Msg.HTML_TEXT).appendField(new ht.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs=160,js={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ht.FieldTable(""),"TEXT")}},Zs={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ht.FieldMultilineInput(""),"TEXT")}},$s={init:function(){this.setColour(zs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ht.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},t_={init:function(){this.setColour(zs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},e_={init:function(){this.setColour(zs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ht.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},i_={init:function(){this.setColour(zs),this.appendValueInput("VALUE").appendField(ht.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},n_={init:function(){this.setColour(zs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ht.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ht.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ht.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},ht.isNumber(n)&&ht.isNumber(s)&&ht.isNumber(_))n=parseFloat(n),s=parseFloat(s),_=Math.abs(parseFloat(_)),0==n%1&&0==s%1&&0==_%1?(n<=s?(s++,t=0==n&&1==_?s:n+", "+s,1!=_&&(t+=", "+_)):t=n+", "+--s+", -"+_,t="range("+t+")"):(t=n",GTE:">="};const Jp=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",_=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+_;else if("OR"==i)o=s+" or "+_;else if("NOR"==i)o="not("+s+"^"+_+")";else o=s+"^"+_;return[o,n]},Qp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},qp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},zp=function(t,e){return["None",e.ORDER_ATOMIC]},jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Zp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ta=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},ea=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},ia=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},na=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},sa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},_a=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},oa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},pa=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},aa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ua=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},la=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},da=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ha=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ma=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ma=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ea=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Oa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ra=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ca=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},ga=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),ht.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var _=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},su=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},_u=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},pu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},au=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},uu=function(t,e){return'"},ru=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},lu=function(){return this.getFieldValue("TEXT")+"\n"},du=function(t){return t.getFieldValue("TEXT")+"\n"},Iu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Tu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},hu=function(){return""},Mu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},mu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),_=0;_0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+_.join("")+o.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},Ou.scrubNakedValue=function(t){return t+"\n"},Ou.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Ou.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Ou.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(_=t.getCommentText())&&(_=ht.utils.string.wrap(_,Ou.COMMENT_WRAP-3),n+=Ou.prefixLines(_+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Ru="#74A55B",cu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_RGB_PIN_COUNT)}},gu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Cu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Su={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Au={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ht.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ht.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Lu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Nu={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_RESET)}},Du={init:function(){this.setColour(Ru),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Fu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Pu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},vu={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Yu={init:function(){this.setColour(Ru),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},xu={init:function(){this.setColour(Ru),this.appendValueInput("VAR").appendField("360°"+ht.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SETTING+ht.Msg.blockpy_turtle_rotate+ht.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},bu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},yu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},Vu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Bu={init:function(){this.setColour(Ru),this.appendValueInput("PIN",Number).appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Gu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new ht.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(ht.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},Uu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ht.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[ht.Msg.MOTOR_N,"ms32006.MOT_N"],[ht.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},wu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new ht.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ht.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},ku={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_RGB_PIN_COUNT)}},Hu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Wu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Ku={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_WRI)}},Ju={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new ht.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+ht.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},Qu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},qu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},zu={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(ht.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},ju={init:function(){this.setColour(Ru),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(ht.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(ht.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(ht.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Zu={init:function(){this.setColour(Ru),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},$u={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},tr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},er={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_TRAFFIC_LIGHT).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.LISTS_SET_INDEX_SET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[ht.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ir={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_WHITE,"W"],[ht.Msg.COLOUR_RGB_RED,"R"],[ht.Msg.COLOUR_RGB_YELLOW,"Y"],[ht.Msg.COLOUR_RGB_GREEN,"G"],[ht.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_WHITE,"W"],[ht.Msg.COLOUR_RGB_RED,"R"],[ht.Msg.COLOUR_RGB_YELLOW,"Y"],[ht.Msg.COLOUR_RGB_GREEN,"G"],[ht.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},sr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[ht.Msg.MIXLY_SPEED,"[1]"],[ht.Msg.MATH_SINGLE_OP_ABSOLUTE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[ht.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[ht.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[ht.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[ht.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MATH_SINGLE_OP_ABSOLUTE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"0"],[ht.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[ht.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},ar={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ur={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField("("+ht.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},rr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.ME_GO_MOTOR_EXTERN+ht.Msg.MIXLY_SERVO_MOTOR).appendField(ht.Msg.MIXLY_RELATIVE+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ht.Msg.MSG.run).appendField("("+ht.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LEFT,"0"],[ht.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MODE).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPEED+ht.Msg.MIXLY_MODE,"0"],[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ht.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ht.inputs.Align.RIGHT).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"0"],[ht.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MOTOR,"ext_motor"],[ht.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ht.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ht.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ht.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ht.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ht.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ht.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},dr={init:function(){this.setColour(Ru),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.ME_GO_MOTOR_EXTERN).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MOTOR,"ext_motor"],[ht.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ht.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ht.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ht.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ht.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ht.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ht.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Ir="#6C9858",Tr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},hr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_ON,"1"],[ht.Msg.MIXLY_ESP32_OFF,"0"],[ht.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},Mr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},mr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Er={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Or={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_BUILDIN_LED+ht.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Rr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ht.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(ht.Msg.MIXLY_LCD_SETCOLOR).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_LIGHT_RED,"1"],[ht.Msg.MIXLY_LIGHT_GREEN,"2"],[ht.Msg.MIXLY_LIGHT_BLUE,"3"],[ht.Msg.MIXLY_LIGHT_YELLOW,"4"],[ht.Msg.MIXLY_LIGHT_CYAN,"5"],[ht.Msg.MIXLY_LIGHT_PURPLE,"6"],[ht.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},cr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},gr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ht.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Cr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ht.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},Sr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETTING).appendField(ht.Msg.MIXLY_BUILDIN_LED).appendField(new ht.FieldDropdown([[ht.Msg.COLOUR_RGB_RED,"r"],[ht.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_BUILDIN_LED+ht.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Ar={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(new ht.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Lr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Mt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Nr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Dr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},fr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.PYTHON_RANGE_STEP).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Fr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_WRI)}},Pr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(Mt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ht.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},vr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ht.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Yr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ht.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.PYTHON_RANGE_STEP).appendField(ht.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Xr={init:function(){this.setColour(Ir),this.appendValueInput("TICKS").setCheck(Number).appendField(ht.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ht.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ht.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},xr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},br={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_RESET)}},yr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Vr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ht.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Br={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gr={init:function(){this.setColour(Ir),this.appendValueInput("LIST").appendField(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Ur={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField("MixGo Car").appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},kr={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField("MixGo Car").appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Hr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([[ht.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ht.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MOTOR_DC).appendField(new ht.FieldDropdown([[ht.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ht.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_STOP).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Jr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ht.Msg.MIXLY_SPEED,"SPEED"],[ht.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Qr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},qr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXBOT).appendField(ht.Msg.MIXLY_MOTOR).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"1"],[ht.Msg.TEXT_TRIM_RIGHT,"2"],[ht.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ht.Msg.MIXLY_SPEED,"SPEED"],[ht.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},zr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[ht.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},jr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(new ht.FieldDropdown([[ht.Msg.blockpy_forward,"F"],[ht.Msg.blockpy_backward,"B"],[ht.Msg.blockpy_left,"L"],[ht.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zr={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(new ht.FieldDropdown([[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.BITBOT).appendField(ht.Msg.MIXLY_MOTOR).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"0"],[ht.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tl={init:function(){this.setColour(Ir),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},el={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},il={init:function(){this.setColour(Ir),this.appendValueInput("bright").appendField(ht.Msg.MIXLY_SETTING+ht.Msg.MIXLY_MIXBOT_BUZZER+ht.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_SETONOFF)}},nl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MIXBOT_BUZZER+ht.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_LED_GETONOFF)}},sl={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_RECORD_AUDIO).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(ht.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},_l={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_PLAY_AUDIO).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ol={init:function(){this.setColour(Ir),this.appendValueInput("PATH").appendField(ht.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},pl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ht.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},al={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ul={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.LISTS_SET_INDEX_SET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},rl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.PIN_NUMBERING).appendField(new ht.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT+ht.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},ll={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.LISTS_SET_INDEX_SET+ht.Msg.ME_GO_MOTOR_EXTERN).appendField(ht.Msg.MIXLY_ALL+ht.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(ht.ALIGN_RIGHT).appendField(ht.Msg.blynk_IOT_IR_POWER+ht.Msg.MIXLY_PINMODEOUT+ht.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},dl={init:function(){this.setColour(Ir),this.appendDummyInput().appendField(ht.Msg.ANALOG+ht.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(ht.Msg.MIXLY_RELEASE).appendField(new ht.FieldDropdown([[ht.Msg.MICROPYTHON_DISPLAY_YES,"True"],[ht.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.ANALOG+ht.Msg.MIXLY_KEYBOARD_INPUT)}},Il={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SPECIAL_KEY).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[ht.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[ht.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[ht.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[ht.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[ht.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[ht.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[ht.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[ht.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},Tl={init:function(){this.setColour(Ir),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GENERAL_KEY).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},hl={init:function(){this.setColour(Ir),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new ht.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(ht.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Sm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Am={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Lm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Nm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ht.Msg.MIXLY_WIFI_USERNAME).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ht.Msg.MIXLY_IOT_PASSWORD).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ht.Msg.MIXLY_EMQX_PROJECT).setAlign(ht.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ht.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ht.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},fm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ht.Msg.MIXLY_EMQX_SUBSCRIBE+ht.Msg.MIXLY_MICROBIT_MSG).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ht.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Fm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ym={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ht.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Xm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ht.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},xm={init:function(){this.setColour(mm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},bm={init:function(){this.setColour(mm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},ym={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ht.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Vm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO").appendField(ht.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ht.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Bm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+ht.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(mm),this.appendDummyInput().appendField(ht.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ht.Msg.MIXLY_EMQX_SERVER).setAlign(ht.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ht.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Um={init:function(){this.VISITOR_ID=Mt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(mm),this.appendDummyInput("").appendField(new ht.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},wm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MixIO").appendField(ht.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},km={init:function(){this.setColour(mm),this.appendDummyInput().appendField("HTTP"+ht.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ht.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ht.Msg.MIXLY_REQUESTS_GET).appendField(ht.Msg.MIXLY_GET_CURRENT_TIME).appendField(ht.Msg.MIXLY_OPEN_DEBUG).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("HTTP"+ht.Msg.MIXLY_Client).appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ht.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ht.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Wm={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MQTT"+ht.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ht.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ht.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ht.Msg.MQTT_Topic).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ht.Msg.MIXLY_OPEN_DEBUG).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ht.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Km={init:function(){this.setColour(mm),this.appendDummyInput().appendField("MQTT"+ht.Msg.MIXLY_Client).appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ht.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ht.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Jm=Em,Qm=Om,qm=Rm,zm=cm,jm=Cm,Zm=225,$m={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(ht.Msg.MIXLY_NETWORK_MODE).appendField(new ht.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},tE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[ht.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=ht.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:ht.Msg.MIXLY_NETWORK_WIFI_OPEN,False:ht.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},eE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},iE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return ht.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:ht.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},nE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(ht.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(ht.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},sE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_NETWORK_WIFI_CONNECT+ht.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},_E={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[ht.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[ht.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:ht.Msg.MIXLY_ESP32_NETWORK_IP,1:ht.Msg.MIXLY_ESP32_NETWORK_MASK,2:ht.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},oE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},pE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[ht.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},aE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(ht.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(ht.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},uE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},rE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new ht.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},lE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},dE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},IE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},TE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},hE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},ME={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},mE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},EE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},OE={init:function(){this.setColour(Zm),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},RE={init:function(){this.setColour(Zm),this.appendValueInput("DOMAIN").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_REQUESTS_GET).appendField(new ht.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},cE={init:function(){this.appendValueInput("VAL");var t=[[ht.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ht.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ht.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ht.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},gE={init:function(){this.appendValueInput("VAR").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ht.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ht.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ht.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},CE={init:function(){this.setColour(Zm),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(ht.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},SE={init:function(){this.setColour(Zm),this.appendDummyInput("").appendField(new ht.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},AE="#3288dd",LE={init:function(){this.setColour(AE),this.appendValueInput("URL").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ht.Msg.blockpy_REQUESTS).appendField(ht.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},NE={init:function(){this.setColour(AE),this.appendValueInput("URL").appendField(ht.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ht.Msg.blockpy_CONDUCT).appendField(new ht.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ht.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ht.Msg.blockpy_REQUESTS+ht.Msg.OLED_STRING),this.appendDummyInput("").appendField(ht.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},DE={init:function(){this.appendValueInput("VAL");var t=[[ht.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ht.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ht.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(AE),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},fE=100,FE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendDummyInput().appendField(t).appendField(ht.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM),this.setOutput(!0,Number),this.setInputsInline(!0)}},PE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendValueInput("PIN").appendField(t).appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},vE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendValueInput("PIN").appendField(t).appendField(ht.Msg.SET_USB),this.appendValueInput("percent").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_POWER_SUPPLY),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},YE={init:function(){if("mixgo_nova"==Mt.Boards.getSelectedBoardKey().split(":")[2])var t="Nova G1";this.setColour(fE),this.appendDummyInput().appendField(t).appendField(ht.Msg.MIXLY_SPK_STATE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ON,"True"],[ht.Msg.MIXLY_OFF,"False"]]),"state"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},XE=100,xE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("I2CSUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(e),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0,Number),this.setInputsInline(!0)}},yE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Direction).appendField(new ht.FieldDropdown([[ht.Msg.CLOCKWISE,"CW"],[ht.Msg.ANTI_CLOCKWISE,"CCW"],[ht.Msg.MOTOR_P,"P"],[ht.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},VE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField(ht.Msg.MOTOR_DC).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_STEPPER_GET_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},BE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_MOVE)}},GE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ht.inputs.Align.RIGHT).appendField(ht.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},UE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("180°"+ht.Msg.MIXLY_SERVO),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},wE={init:function(){var t=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_ce"==t)var e="CE G6";else if("mixgo_pe"==t)e="PE G1";this.setColour(XE),this.appendValueInput("SUB").appendField(e).setCheck("var"),this.appendValueInput("PIN").appendField("360°"+ht.Msg.MIXLY_SERVO).appendField(ht.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET+ht.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},kE="#A58C5B",HE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SENOR_IS_PRESSED)}},WE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_SENOR_WAS_PRESSED)}},KE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(ht.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.PROCEDURES_DEFRETURN_RETURN+ht.Msg.MIXLY_BUTTON+ht.Msg.MIXLY_GET_PRESSES)}},JE={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_BUTTON).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ht.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ht.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},QE={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_shake,"shake"],[ht.Msg.MIXLY_UP,"up"],[ht.Msg.MIXLY_DOWN,"down"],[ht.Msg.MIXLY_LEFT,"left"],[ht.Msg.MIXLY_RIGHT,"right"],[ht.Msg.MIXLY_MICROBIT_face_up,"face up"],[ht.Msg.MIXLY_MICROBIT_face_down,"face down"],[ht.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ht.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ht.Msg.MSG.catSensor,s=ht.Msg.MIXLY_MICROBIT_JS_STATE,_=ht.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ht.Msg.MIXLY_MICROBIT_shake,up:ht.Msg.MIXLY_UP,down:ht.Msg.MIXLY_DOWN,left:ht.Msg.MIXLY_LEFT,right:ht.Msg.MIXLY_RIGHT,"face up":ht.Msg.MIXLY_MICROBIT_face_up,"face down":ht.Msg.MIXLY_MICROBIT_face_down,freefall:ht.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+_}))}},qE={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},zE={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},jE={init:function(){var t=[[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(kE),this.appendValueInput("PIN",Number).appendField(new ht.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new ht.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:ht.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},ZE={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},$E={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},tO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ht.FieldDropdown([[ht.Msg.TEXT_TRIM_LEFT,"left"],[ht.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(ht.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=ht.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=ht.Msg.MIXLY_ESP32_NEAR;return i+{left:ht.Msg.TEXT_TRIM_LEFT,right:ht.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},eO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[ht.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":ht.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":ht.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},iO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[ht.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},nO={init:function(){this.setColour(kE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},sO={init:function(){this.setColour(kE),this.appendDummyInput("").appendField("LM35"+ht.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ht.Msg.MIXLY_TOOLTIP_LM35)}},_O={init:function(){this.setColour(kE),this.appendValueInput("I2CSUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ht.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},oO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[ht.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[ht.Msg.MIXLY_ESP32_MAX30102_IR+","+ht.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},pO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[ht.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[ht.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.HTML_COLOUR+ht.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET+ht.Msg.HTML_COLOUR,"[2]"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_IR_STRENGTH,"[1]"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},rO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.HTML_COLOUR+ht.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET+"RGB"+ht.Msg.HTML_COLOUR,"0"],[ht.Msg.MIXLY_GET+ht.Msg.MIXLY_RGB_RAW,"1"],[ht.Msg.MIXLY_GET_ENV_LIGHT+ht.Msg.MIXLY_BRIGHTNESS,"2"],[ht.Msg.GET_IR_STRENGTH+ht.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},lO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GET_ENV_LIGHT,"E"],[ht.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},dO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},IO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},TO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ht.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:ht.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},hO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_Altitude+ht.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETPRESSURE,"pressure()"],[ht.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ht.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},MO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_Altitude+ht.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_GETPRESSURE,"pressure()"],[ht.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ht.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},mO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MIXGOPE_FIELD+ht.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[ht.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},EO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_shake,"shake"],[ht.Msg.MIXLY_UP,"up"],[ht.Msg.MIXLY_DOWN,"down"],[ht.Msg.MIXLY_LEFT,"left"],[ht.Msg.MIXLY_RIGHT,"right"],[ht.Msg.MIXLY_MICROBIT_face_up,"face up"],[ht.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ht.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ht.Msg.MSG.catSensor,s=ht.Msg.MIXLY_MICROBIT_JS_STATE,_=ht.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ht.Msg.MIXLY_MICROBIT_shake,up:ht.Msg.MIXLY_UP,down:ht.Msg.MIXLY_DOWN,left:ht.Msg.MIXLY_LEFT,right:ht.Msg.MIXLY_RIGHT,"face up":ht.Msg.MIXLY_MICROBIT_face_up,"face down":ht.Msg.MIXLY_MICROBIT_face_down}[e]+_}))}},OO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},RO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_GET+ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},cO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+ht.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new ht.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ht.Msg.MIXLY_MICROBIT_Direction,s=ht.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":ht.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},gO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},CO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_GETTEMPERATUE)}},SO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return ht.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:ht.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:ht.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},AO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},LO={init:function(){this.setColour(kE),this.appendValueInput("SPISUB").appendField(ht.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ht.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP+ht.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ht.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},NO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[ht.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},DO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},fO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"+ht.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},FO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ht.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},PO={init:function(){this.setColour(kE),this.appendDummyInput().appendField(ht.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ht.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ht.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(ht.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},vO={init:function(){this.setColour(kE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RFID_SCAN_OK,"0"],[ht.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[ht.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},YO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ht.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},XO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},xO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bO={init:function(){this.setColour(kE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ht.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&_)):(2048<=_&&_<=55295||57344<=_&&_<=65535)&&(n+=3,i.push(224|15&_>>12),i.push(128|63&_>>6),i.push(128|63&_))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+_+",font_address="+p+")\n"):"16x8 Matrix"==o&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+_+")\n"),i},CN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},SN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},AN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},LN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},NN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},DN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},fN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},FN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},PN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},vN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},YN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},XN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},xN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},bN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},yN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},VN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},BN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},GN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},UN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"width",e.ORDER_ATOMIC),o=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+_+", "+o+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+_+", "+o+","+a+")\n"}},wN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+_+", 1)\n"},kN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},HN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},WN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},KN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},JN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),_=e.valueToCode(this,"r",e.ORDER_ATOMIC),o="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(o){case"True":return i+".show_fill_circle("+n+", "+s+", "+_+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+_+", "+p+")\n"}},QN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),_=e.valueToCode(this,"x1",e.ORDER_ATOMIC),o=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+_+", "+o+", "+p+", "+a+", "+r+")\n"}},qN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},zN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},jN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),_=this.getFieldValue("key");return"TM1650"==_?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+_+"("+s+")\n"):"TM1637"==_&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+_+"("+s+")\n"),i},ZN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},$N=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},tD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},eD=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},iD=function(t,e){e.definitions_.import_st7789="import st7789";var i=Mt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+_+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+o+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},nD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+_+",size = "+o+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},sD=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},_D=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},oD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},pD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},aD=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},uD=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),_=e.valueToCode(this,"x2",e.ORDER_ATOMIC),o=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+_+", "+o+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+_+", "+o+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},rD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),_=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+_+")\n"},lD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},dD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},ID=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},TD=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},hD=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),_=Mt.Boards.getSelectedBoardKey().split(":")[2],o="";return o=["mpython","mixgo_pe","mixgo_nova"].indexOf(_)>=0?"0x700000":["mixgo_zero"].indexOf(_)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+o+")\n"},MD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},mD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},ED=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},OD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},RD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},cD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},gD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},CD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},SD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},AD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},LD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},ND=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},DD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+_+", "+o+", "+p+")\n"+i+".show()\n"},fD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\n"+i+".show()\n"},FD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},PD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},vD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),_=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+_+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+_+")\n")},YD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},XD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},xD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},bD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},yD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},VD=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},BD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let _="",o=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),o+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);_+=n(o.toString(16)),s.unshift(_)}let _=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Ef=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+_+",size = "+o+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},Of=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},Rf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color="+o+")\n";else{const t=o.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+_+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},cf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},gf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+_+",speed ="+o+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},Cf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"w",e.ORDER_ATOMIC),o=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},Sf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"length",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==o.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},Af=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),_=e.valueToCode(t,"x2",e.ORDER_ATOMIC),o=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+_+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},Lf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},Nf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},Df=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},ff=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var o="onboard_tft.pixel(int("+n+"), int("+s+"), "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return o},Ff=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},Pf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},vf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},Yf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=o+"=Clock("+n+","+s+","+_+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=o+"=Clock("+n+","+s+","+_+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Xf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},xf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},bf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},yf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var _=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_=n+".clear(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\n"}return _},Vf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),_=e.valueToCode(t,"r",e.ORDER_ATOMIC),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==o.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", "+o+","+p+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+_+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Bf=function(t,e){var i=Mt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Gf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},Uf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},wf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},qX=function(){return"control.reset()\n"},zX=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},jX=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},ZX=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},$X=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},tx=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},ex=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},ix=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},nx=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},sx=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},_x=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},ox=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},px=function(){return"while True:\n pass\n"},ax=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},ux=function(t,e){return e.definitions_.import_os="import os","os.uname()"},rx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},lx=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},dx=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Ix=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},Tx=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},hx=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},Mx=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},mx=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},Ex=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},Ox=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},Rx=hx,cx=Ix,gx=Tx,Cx=rx,Sx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ax=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Lx=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Nx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},Dx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},fx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Fx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Px=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},vx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Yx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},Xx=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},xx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},bx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},yx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Vx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},Bx={};Bx["元控青春"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","spk_midi.DADADADUM"],["ENTERTAINER","spk_midi.ENTERTAINER"],["PRELUDE","spk_midi.PRELUDE"],["ODE","spk_midi.ODE"],["NYAN","spk_midi.NYAN"],["RINGTONE","spk_midi.RINGTONE"],["FUNK","spk_midi.FUNK"],["BLUES","spk_midi.BLUES"],["BIRTHDAY","spk_midi.BIRTHDAY"],["WEDDING","spk_midi.WEDDING"],["FUNERAL","spk_midi.FUNERAL"],["PUNCHLINE","spk_midi.PUNCHLINE"],["PYTHON","spk_midi.PYTHON"],["BADDY","spk_midi.BADDY"],["CHASE","spk_midi.CHASE"],["BA_DING","spk_midi.BA_DING"],["WAWAWAWAA","spk_midi.WAWAWAWAA"],["JUMP_UP","spk_midi.JUMP_UP"],["JUMP_DOWN","spk_midi.JUMP_DOWN"],["POWER_UP","spk_midi.POWER_UP"],["POWER_DOWN","spk_midi.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Bx["元控"]={description:"MicroPython[ESP32C3 MixGo CE]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM","spk_midi.DADADADUM"],["ENTERTAINER","spk_midi.ENTERTAINER"],["PRELUDE","spk_midi.PRELUDE"],["ODE","spk_midi.ODE"],["NYAN","spk_midi.NYAN"],["RINGTONE","spk_midi.RINGTONE"],["FUNK","spk_midi.FUNK"],["BLUES","spk_midi.BLUES"],["BIRTHDAY","spk_midi.BIRTHDAY"],["WEDDING","spk_midi.WEDDING"],["FUNERAL","spk_midi.FUNERAL"],["PUNCHLINE","spk_midi.PUNCHLINE"],["PYTHON","spk_midi.PYTHON"],["BADDY","spk_midi.BADDY"],["CHASE","spk_midi.CHASE"],["BA_DING","spk_midi.BA_DING"],["WAWAWAWAA","spk_midi.WAWAWAWAA"],["JUMP_UP","spk_midi.JUMP_UP"],["JUMP_DOWN","spk_midi.JUMP_DOWN"],["POWER_UP","spk_midi.POWER_UP"],["POWER_DOWN","spk_midi.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]},Bx["ESP32S2 Generic"]={description:"MicroPython[ESP32C3 MixGo CC]",digital_pin:Mt.Profile.generate(["0-18","21","33-48"]),input_pin:Mt.Profile.generate(["0-18","21","33-48"]),output_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm_input:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_input:Mt.Profile.generate(["1-18"],"adc","adc"),pwm_output:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_output:Mt.Profile.generate(["1-18"],"adc","adc"),espnow_channel:Mt.Profile.generate(["1-13"]),haskylens_model:Mt.Profile.generate(["0-4"]),digital:Mt.Profile.generate(["0-18","21","33-48"],"pin","pin"),pwm_pin:Mt.Profile.generate(["0-18","21","33-48"]),pwm:Mt.Profile.generate(["0-18","21","33-48"],"pwm","pwm"),analog_pin:Mt.Profile.generate(["1-18"]),analog:Mt.Profile.generate(["1-18"],"adc","adc"),touch:Mt.Profile.generate(["1-14"],"tc","tc"),touch_pin:Mt.Profile.generate(["1-14"]),button:[["B1","B1key"],["B2","B2key"],["A1","A1key"],["A2","A2key"],["A3","A3key"],["A4","A4key"]],buttonB:[["B1","B1key"],["B2","B2key"]],axis:Mt.Profile.generate(["0-4"]),exlcdh:Mt.Profile.generate(["0-15"]),exlcdv:Mt.Profile.generate(["0-7"]),brightness:Mt.Profile.generate(["0-9"]),tts_voice:Mt.Profile.generate(["0-16"]),tts_builtin_music:Mt.Profile.generate(["0-47"]),tts_bgmusic:Mt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","matrix.Image.ALL_CLOCKS"],["ALL_ARROWS","matrix.Image.ALL_ARROWS"]],playlist:[["DADADADUM",".DADADADUM"],["ENTERTAINER",".ENTERTAINER"],["PRELUDE",".PRELUDE"],["ODE",".ODE"],["NYAN",".NYAN"],["RINGTONE",".RINGTONE"],["FUNK",".FUNK"],["BLUES",".BLUES"],["BIRTHDAY",".BIRTHDAY"],["WEDDING",".WEDDING"],["FUNERAL",".FUNERAL"],["PUNCHLINE",".PUNCHLINE"],["PYTHON",".PYTHON"],["BADDY",".BADDY"],["CHASE",".CHASE"],["BA_DING",".BA_DING"],["WAWAWAWAA",".WAWAWAWAA"],["JUMP_UP",".JUMP_UP"],["JUMP_DOWN",".JUMP_DOWN"],["POWER_UP",".POWER_UP"],["POWER_DOWN",".POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"]]};const Gx=Bx,Ux=20,wx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_HIGH,"HIGH"],[ht.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},kx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(ht.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},Hx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},Wx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField("DAC"+ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP)}},Kx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendDummyInput().appendField(ht.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_mSecond,"period"],[ht.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP)}},Jx={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_Analog_PINMODEIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_REF_VOLTAGE+ht.Msg.MIXLY_STAT).appendField(new ht.FieldDropdown([["3.3V","machine.ADC.ATTN_11DB"],["2.2V","machine.ADC.ATTN_6DB"],["1.5V","machine.ADC.ATTN_2_5DB"],["1.2V","machine.ADC.ATTN_0DB"]]),"atten"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP)}},Qx={init:function(){this.setColour(Ux),this.appendValueInput("pin").appendField(ht.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ht.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(ht.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP)}},qx={init:function(){this.setColour(20),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_ATTACHINTERRUPT_PIN).setCheck(Number),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MODE).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ht.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ht.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ht.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},zx={init:function(){this.setColour(20),this.appendDummyInput().appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("pin#"),"PIN_OBJ"),this.appendDummyInput("").appendField(ht.Msg.MIXLY_MICROPYTHON_AS).appendField(new ht.FieldDropdown([[ht.Msg.MIXLY_Digital_PINMODEOUT,"machine.Pin.OUT"],[ht.Msg.MIXLY_Digital_PINMODEIN,"machine.Pin.IN"],[ht.Msg.MIXLY_PINMODEPULLUP,"machine.Pin.IN, machine.Pin.PULL_UP"],[ht.Msg.MIXLY_PINMODEPULLDOWN,"machine.Pin.IN, machine.Pin.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)},getVars:function(){return["pin#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},jx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("dac#"),"PIN_OBJ").appendField(ht.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField("DAC"+ht.Msg.MIXLY_Analog_PINMODEOUT),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_INIT_TOOLTIP)},getVars:function(){return["dac#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},Zx={init:function(){this.setColour(Ux),this.appendDummyInput("").appendField(ht.Msg.MIXLY_SETUP).appendField(new ht.FieldTextInput("tc#"),"PIN_OBJ").appendField(ht.Msg.MIXLY_MICROPYTHON_AS),this.appendDummyInput("").appendField(ht.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendValueInput("PIN",Number).appendField(ht.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_INIT_TOOLTIP)},getVars:function(){return["tc#"==this.getFieldValue("PIN_OBJ")?null:this.getFieldValue("PIN_OBJ")]},renameVar:function(t,e){ht.Names.equals(t,this.getFieldValue("PIN_OBJ"))&&this.setTitleValue(e,"PIN_OBJ")}},$x={init:function(){this.setColour(Ux),this.appendValueInput("PIN",Number).appendField("PWM"+ht.Msg.MIXLY_Analog_PINMODEOUT).setCheck(Number),this.appendValueInput("NUM",Number).appendField(ht.Msg.MIXLY_FREQUENCY+ht.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ht.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP)}},tb=zx,eb=Zx,ib=Qx,nb=qx,sb=230,_b={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital),"PIN"),this.setOutput(!0)}},ob={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},pb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},ab={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},ub={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},rb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},lb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},db={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Ib={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Tb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},hb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},Mb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},mb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Eb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ob={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Rb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},cb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog),"PIN"),this.setOutput(!0)}},gb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},Cb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.dac),"PIN"),this.setOutput(!0)}},Sb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Ab={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},Lb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.buttonB),"PIN"),this.setOutput(!0,Number)}},Nb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},Db={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},fb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},Fb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.touch),"PIN"),this.setOutput(!0)}},Pb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},vb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Yb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},Xb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},xb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},bb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},yb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},Vb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Bb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Gb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Ub={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},wb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},kb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},Hb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Wb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},Kb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Jb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},Qb={init:function(){this.setColour(sb),this.appendDummyInput("").appendField(new ht.FieldDropdown(Mt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},qb=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},zb=function(t,e){e.definitions_.import_machine="import machine";var i="";return i+=e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},jb=function(t,e){e.definitions_.import_machine="import machine";return[e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".value()",e.ORDER_ATOMIC]},Zb=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},$b=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},ty=function(t,e){return e.definitions_.import_machine="import machine",[e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},ey=function(t,e){e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"machine.Pin("+i+").irq(handler = "+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger = "+n+")\n"},iy=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"pin#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=this.getFieldValue("MODE");return("pin#"==i?"pin"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.Pin("+n+", "+s+")\n"},ny=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"dac#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("dac#"==i?"dac"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.DAC(machine.Pin("+n+"))\n"},sy=function(t,e){return e.definitions_.import_machine="import machine",e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".atten("+this.getFieldValue("atten")+")\n"},_y=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("PIN_OBJ")||"tc#",n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC);return("tc#"==i?"tc"+n:e.variableDB_.getName(i,ht.Variables.NAME_TYPE))+" = machine.TouchPad(machine.Pin("+n+"))\n"},oy=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},py=oy,ay=oy,uy=oy,ry=oy,ly=oy,dy=oy,Iy=oy,Ty=oy,hy=oy,My=oy,my=oy,Ey=oy,Oy=oy,Ry=oy,cy=oy,gy=oy,Cy=oy,Sy=oy,Ay=oy,Ly=oy,Ny=oy,Dy=oy,fy=oy,Fy=oy,Py=oy,vy=oy,Yy=oy,Xy=oy,xy=oy,by=oy,yy=oy,Vy=oy,By=oy,Gy=oy,Uy=oy,wy=oy,ky=oy,Hy=oy,Wy=oy,Ky=oy,Jy=oy,Qy=oy,qy=oy,zy=oy;Object.assign(ht.Variables,Et),Object.assign(ht.Procedures,jn),ht.Python=Ou,ht.generator=Ou,Mt.Profile.default={},Object.assign(Mt.Profile,Gx),Object.assign(Mt.Profile.default,Gx["MixGo CE"]),Object.assign(ht.Blocks,e,i,n,s,_,o,p,a,u,r,l,d,I,b,H,k,v,y,W,f,w,U,G,V,F,D,N,X,Y,x,P,B,lt,dt),Object.assign(ht.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,et,ut,at,j,it,rt,Q,pt,ot,_t,nt,q,J,K,$,Z,tt,z,st,It,Tt)})(); \ No newline at end of file diff --git a/boards/default/micropython_k210_mixgoai/main.bundle.js b/boards/default/micropython_k210_mixgoai/main.bundle.js index 3629f3e9..e5e4d33b 100644 --- a/boards/default/micropython_k210_mixgoai/main.bundle.js +++ b/boards/default/micropython_k210_mixgoai/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class At{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ut={init:function(){this.setColour(bt),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},wt={init:function(){this.setColour(bt),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Rt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Bt={init:function(){this.setColour(bt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Wt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Kt={init:function(){this.setColour(bt);var t=new Rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Bt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Kt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},$t={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},te={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},ee={init:function(){this.jsonInit({message0:Rt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:bt,tooltip:Rt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Rt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ie={init:function(){this.setColour(bt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_STAT),this.setOutput(!0)}},ne={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},se={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},oe={init:function(){this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Rt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Rt.FieldDropdown([[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(bt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},pe={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ue={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},ae={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},le={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET+Rt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_GET_UNIQUE_IDEN)}},_e={init:function(){this.setColour(bt),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},re=230;Rt.FieldTextInput.math_number_validator=function(t){return String(t)},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const de={init:function(){this.setColour(re),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Ie={init:function(){this.setColour(re);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Te={init:function(){this.setColour(re);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},he={init:function(){this.setColour(re),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},me={init:function(){this.setColour(re),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ce={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Oe={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Re={init:function(){var t=[[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_HEX,"hex"]];this.setColour(re),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Rt.Msg.MATH_DEC_TOOLTIP_BIN,oct:Rt.Msg.MATH_DEC_TOOLTIP_OCT,hex:Rt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Me={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(re),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ee={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(re),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ce={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(re),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ae={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(re),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Se={init:function(){this.setColour(re),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},De={init:function(){this.setColour(re),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Ne={init:function(){this.setColour(re),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},fe={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MATH_ROUND).appendField(Rt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Rt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Le={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"],[Rt.Msg.MIXLY_TO_BITES,"b"],[Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(re),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Fe={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(re),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ve=Se,Pe={init:function(){this.setColour(re),this.appendValueInput("VAR").appendField(Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ve={init:function(){this.setColour(re),this.itemCount_=1,this.setMutator(new Rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Rt.Msg.MIXLY_PRODUCT+Rt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Rt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ke={init:function(){this.setColour(ye),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Rt.FieldTextInput("",Rt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Rt.FieldImage(e,7,12,'"')}},xe={init:function(){this.setColour(ye),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Rt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Xe={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ge={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(String).appendField(Rt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},He={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ue={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},we={init:function(){this.WHERE_OPTIONS=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.TEXT_GET_INDEX_RANDOM+1+Rt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.LISTS_GET_INDEX_GET,"MODE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Rt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+Rt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Rt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:Rt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Rt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Rt.Msg.TEXT_GET_INDEX_RANDOM};return Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+Rt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Rt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Rt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Be={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.LISTS_GET_INDEX_FROM_START+"n"+Rt.Msg.TEXT_CHARAT2)}},We={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Rt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Rt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ke={init:function(){this.WHERE_OPTIONS_1=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Rt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new Rt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Qe={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},je={init:function(){var t=[[Rt.Msg.MIXLY_EQUALS,"==="],[Rt.Msg.MIXLY_STARTSWITH,"startswith"],[Rt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ye),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Rt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},qe={init:function(){this.setColour(ye),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_COMPARETO_HELP)}},Je={init:function(){var t=[[Rt.Msg.TEXT_UPPER,"upper"],[Rt.Msg.TEXT_TITLE,"title"],[Rt.Msg.TEXT_CAPITALIZE,"capitalize"],[Rt.Msg.TEXT_SWAPCASE,"swapcase"],[Rt.Msg.TEXT_LOWER,"lower"]];this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Rt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Rt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Rt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Rt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Rt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Rt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ze={init:function(){var t=[[Rt.Msg.TEXT_LJUST,"ljust"],[Rt.Msg.TEXT_CENTER,"center"],[Rt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ye),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Rt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ze={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Rt.Msg.MIXLY_MID+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Rt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},$e={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ti={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Rt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},ei={init:function(){this.setColour(ye),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Rt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Rt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ii={init:function(){var t=[[Rt.Msg.TEXT_TRIM_BOTH,"strip"],[Rt.Msg.TEXT_TRIM_LEFT,"lstrip"],[Rt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ye),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Rt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Rt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Rt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ni={init:function(){this.setColour(ye),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Rt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Zi={init:function(){this.setColour(Ji),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},$i={init:function(){this.setColour(Ji),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},tn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_KEYS),this.setTooltip(Rt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_TOOLTIP)}},nn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},sn={init:function(){this.setColour(Ji),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},on={init:function(){this.setColour(Ji),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_DELETE_TOOLTIP)}},pn={init:function(){this.setColour(Ji),this.appendValueInput("DICT2").setCheck("Dict").appendField(Rt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Rt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MID),this.setTooltip(Rt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},un={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_CLEAR),this.setTooltip(Rt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_ITEMS),this.setTooltip(Rt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},ln={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_VALUES),this.setTooltip(Rt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},_n={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_LENGTH),this.setTooltip(Rt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},rn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_DELDICT),this.setTooltip(Rt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dn={init:function(){this.MODE=[[Rt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Rt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Rt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Rt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Rt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Rt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},In={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setTooltip(Rt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Tn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},hn={init:function(){this.setColour(Ji),this.appendDummyInput("").appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Rt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mn={init:function(){this.setColour(Ji),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},cn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},On={init:function(){this.setColour(Ji),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Rn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn=210,En={init:function(){var t=Rt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Cn={init:function(){var t=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Rt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},An={init:function(){var t=[[Rt.Msg.LOGIC_OPERATION_AND,"AND"],[Rt.Msg.LOGIC_OPERATION_OR,"OR"],[Rt.Msg.LOGIC_OPERATION_NOR,"NOR"],[Rt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Rt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Rt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Rt.Msg.LOGIC_NEGATE_TOOLTIP)}},Sn={init:function(){var t=[[Rt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Rt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Rt.FieldDropdown(t),"BOOL"),this.setTooltip(Rt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Dn={init:function(){this.setColour(Mn),this.setOutput(!0),this.appendDummyInput().appendField(Rt.Msg.LOGIC_NULL),this.setTooltip(Rt.Msg.LOGIC_NULL_TOOLTIP)}},Nn={init:function(){this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Rt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Rt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},fn={init:function(){var t=[[Rt.Msg.TEXT_APPEND_TO,"in"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Rt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Rt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.IN)}},Ln={init:function(){var t=[[Rt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Fn={init:function(){this.setColour(Mn),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},vn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Rt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXPY_TEXT_ENCODE).appendField(new Rt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MICROBIT_PYTHON_TYPE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.HTML_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Qn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},jn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Rt.Msg.MIXLY_ESP32_SET+{mkdir:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Rt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_FILE,"isfile"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Rt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$n={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Rt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},ts={};ts.NAME_TYPE=Rt.PROCEDURE_CATEGORY_NAME,ts.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Js={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_FORM_CONTENT).appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_TEXT,"text"],[Rt.Msg.HTML_EMAIL,"email"],[Rt.Msg.HTML_NUMBER,"number"],[Rt.Msg.HTML_PASSWORD,"password"],[Rt.Msg.HTML_CHECKBOX,"checkbox"],[Rt.Msg.HTML_RADIOBUTTON,"radiobutton"],[Rt.Msg.HTML_BUTTON,"button"],[Rt.Msg.HTML_COLOUR,"colour"],[Rt.Msg.HTML_DATE,"date"],[Rt.Msg.HTML_LOCALTIME,"local time"],[Rt.Msg.HTML_FILE,"file"],[Rt.Msg.HTML_HIDDEN,"hidden"],[Rt.Msg.HTML_IMAGE,"image"],[Rt.Msg.HTML_MONTH,"month"],[Rt.Msg.HTML_RANGE,"range"],[Rt.Msg.HTML_RESET,"reset"],[Rt.Msg.HTML_SEARCH,"search"],[Rt.Msg.HTML_SUBMIT,"submit"],[Rt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Rt.Msg.HTML_TIME,"time"],[Rt.Msg.HTML_URL,"url"],[Rt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Rt.Msg.HTML_NAME).appendField(new Rt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Rt.Msg.HTML_VALUE).appendField(new Rt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_TEXT).appendField(new Rt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},to=160,eo={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Rt.FieldTable(""),"TEXT")}},io={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT")}},no={init:function(){this.setColour(to),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},so={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},oo={init:function(){this.setColour(to),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Rt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},po={init:function(){this.setColour(to),this.appendValueInput("VALUE").appendField(Rt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},uo={init:function(){this.setColour(to),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Rt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+l()+"("+t+", "+e+", "+i+")"},Rt.isNumber(n)&&Rt.isNumber(s)&&Rt.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const zu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var p=s+" and "+o;else if("OR"==i)p=s+" or "+o;else if("NOR"==i)p="not("+s+"^"+o+")";else p=s+"^"+o;return[p,n]},Zu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},$u=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ta=function(t,e){return["None",e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ia=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},na=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sa=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},oa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},pa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ua=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},aa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},la=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},_a=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ra=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Ta=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},ha=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ma=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ma=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ea=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Aa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Da=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Na=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},fa=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),Rt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],p=0;p\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},al=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ll=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},_l=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},rl=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},dl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Il=function(t,e){return'"},Tl=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},hl=function(){return this.getFieldValue("TEXT")+"\n"},ml=function(t){return t.getFieldValue("TEXT")+"\n"},cl=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ol=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Rl=function(){return""},Ml=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},El=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+p.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+p.join("\n")},Al.scrubNakedValue=function(t){return t+"\n"},Al.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Al.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Al.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=Rt.utils.string.wrap(o,Al.COMMENT_WRAP-3),n+=Al.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const gl=100,Sl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_SERVO).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Dl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["1","1"],["2","2"]]),"op"),this.setOutput(!0)}},Nl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"1"],[Rt.Msg.MIXLY_ESP32_OFF,"0"],[Rt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},fl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Ll={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Fl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},vl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Pl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Vl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETBRIGHT)}},yl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Yl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},bl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_NOTONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},kl={init:function(){this.setColour(gl),this.appendValueInput("TICKS").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Rt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Rt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},xl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Xl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Gl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Hl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ul={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Bl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Wl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MIXGO_MUSIC_PLAY_TONE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAYSHOW)}},Kl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_RGB_PIN_COUNT)}},Ql={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},jl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},ql={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},Jl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},zl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Zl=vl,$l=Pl,t_=Vl,e_="#2FAD7A",i_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},n_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},s_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},o_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},p_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_MESSAGE0})}},u_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_RUN_MESSAGE0})}},a_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_MESSAGE0,args0:[{check:String,type:"input_value",name:"notification"}]})}},l_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_MESSAGE0,args0:[{check:Number,type:"input_value",name:"timer_num"}]})}},__={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_MESSAGE0,args0:[{check:String,type:"input_value",name:"attribute_name"},{type:"input_value",name:"attribute_value"}]})}},r_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_EMAIL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_EMAIL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_EMAIL_MESSAGE0,args0:[{check:String,type:"input_value",name:"TargetEmail"},{check:String,type:"input_value",name:"subject"},{check:String,type:"input_value",name:"body"}]})}},d_={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_MESSAGE0})}},I_={init:function(){this.jsonInit({message0:Rt.Msg.MPYTHON_BLYNKTIMER_MESSAGE0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,args0:[{check:Number,type:"input_value",name:"Num"},{options:[[Rt.Msg.MIXLY_PYTHON_PERIODIC,"False"],[Rt.Msg.MIXLY_PYTHON_ONE_SHOT,"True"]],type:"field_dropdown",name:"Timer_mode"},{check:Number,type:"input_value",name:"period"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},T_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_MESSAGE0,args0:[{type:"input_value",name:"sensor_data"},{check:Number,type:"input_value",name:"virtual_pin"}]})}},h_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_DATA_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_DATA_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"},{type:"input_value",name:"virtual_pin_val"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},m_={init:function(){this.jsonInit({nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SETUP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SETUP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SETUP_MESSAGE0,args0:[{type:"input_dummy"},{check:String,type:"input_value",name:"server"},{check:Number,type:"input_value",name:"port"},{check:String,type:"input_value",name:"auth"}]})}},c_=120;({init:function(){this.setColour(c_),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT).appendField(new Rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}}).OPERATORS=[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];({init:function(){this.setColour(c_);var t=new Rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}}).OPERATORS=[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const O_=180,R_={colourOptions:["#f00","#000"],columns:2},M_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:Rt.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Clear_display)}},E_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_POINT),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_BRIGHTNESS)}},C_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BRIGHTNESS).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("STAT").setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_DISPLAY_SETPIXEL)}},A_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},g_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DELAY),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},S_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_MONITOR_SHOW_STATIC),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SHOW_STATIC)}},D_={init:function(){this.setColour(O_),this.appendValueInput("PIN",String).setCheck("esp32_image").appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP)}},N_={init:function(){this.jsonInit({colour:O_,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:Rt.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}]})}},f_={init:function(){this.jsonInit({colour:O_,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:Rt.Msg.MIXLY_MICROBIT_Animate_images,args0:[{check:"List",type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+Rt.Msg.MIXLY_MICROBIT_Animate_images1)}},L_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:Rt.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},F_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[Rt.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(Rt.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=Rt.Msg.MIXLY_MICROBIT_monitor;return{on:Rt.Msg.MIXLY_MICROBIT_Turn_on_display,off:Rt.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},v_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:Rt.Msg.MIXLY_MICROBIT_Turn_off_display})}},P_={init:function(){this.jsonInit({colour:O_,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:Rt.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Display_is_on1)}},V_={init:function(){this.jsonInit({colour:O_,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}],output:["esp32_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:Rt.Msg.MIXLY_MICROBIT_Built_in_image1,message0:Rt.Msg.MIXLY_MICROBIT_Built_in_image})}},y_={init:function(){this.jsonInit({colour:O_,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{colour:"#000000",type:"field_colour",name:"05"},{colour:"#000000",type:"field_colour",name:"06"},{colour:"#000000",type:"field_colour",name:"07"},{colour:"#000000",type:"field_colour",name:"08"},{colour:"#000000",type:"field_colour",name:"09"},{colour:"#000000",type:"field_colour",name:"0a"},{colour:"#000000",type:"field_colour",name:"0b"},{colour:"#000000",type:"field_colour",name:"0c"},{colour:"#000000",type:"field_colour",name:"0d"},{colour:"#000000",type:"field_colour",name:"0e"},{colour:"#000000",type:"field_colour",name:"0f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{colour:"#000000",type:"field_colour",name:"15"},{colour:"#000000",type:"field_colour",name:"16"},{colour:"#000000",type:"field_colour",name:"17"},{colour:"#000000",type:"field_colour",name:"18"},{colour:"#000000",type:"field_colour",name:"19"},{colour:"#000000",type:"field_colour",name:"1a"},{colour:"#000000",type:"field_colour",name:"1b"},{colour:"#000000",type:"field_colour",name:"1c"},{colour:"#000000",type:"field_colour",name:"1d"},{colour:"#000000",type:"field_colour",name:"1e"},{colour:"#000000",type:"field_colour",name:"1f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{colour:"#000000",type:"field_colour",name:"25"},{colour:"#000000",type:"field_colour",name:"26"},{colour:"#000000",type:"field_colour",name:"27"},{colour:"#000000",type:"field_colour",name:"28"},{colour:"#000000",type:"field_colour",name:"29"},{colour:"#000000",type:"field_colour",name:"2a"},{colour:"#000000",type:"field_colour",name:"2b"},{colour:"#000000",type:"field_colour",name:"2c"},{colour:"#000000",type:"field_colour",name:"2d"},{colour:"#000000",type:"field_colour",name:"2e"},{colour:"#000000",type:"field_colour",name:"2f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{colour:"#000000",type:"field_colour",name:"35"},{colour:"#000000",type:"field_colour",name:"36"},{colour:"#000000",type:"field_colour",name:"37"},{colour:"#000000",type:"field_colour",name:"38"},{colour:"#000000",type:"field_colour",name:"39"},{colour:"#000000",type:"field_colour",name:"3a"},{colour:"#000000",type:"field_colour",name:"3b"},{colour:"#000000",type:"field_colour",name:"3c"},{colour:"#000000",type:"field_colour",name:"3d"},{colour:"#000000",type:"field_colour",name:"3e"},{colour:"#000000",type:"field_colour",name:"3f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"},{colour:"#000000",type:"field_colour",name:"45"},{colour:"#000000",type:"field_colour",name:"46"},{colour:"#000000",type:"field_colour",name:"47"},{colour:"#000000",type:"field_colour",name:"48"},{colour:"#000000",type:"field_colour",name:"49"},{colour:"#000000",type:"field_colour",name:"4a"},{colour:"#000000",type:"field_colour",name:"4b"},{colour:"#000000",type:"field_colour",name:"4c"},{colour:"#000000",type:"field_colour",name:"4d"},{colour:"#000000",type:"field_colour",name:"4e"},{colour:"#000000",type:"field_colour",name:"4f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"50"},{colour:"#000000",type:"field_colour",name:"51"},{colour:"#000000",type:"field_colour",name:"52"},{colour:"#000000",type:"field_colour",name:"53"},{colour:"#000000",type:"field_colour",name:"54"},{colour:"#000000",type:"field_colour",name:"55"},{colour:"#000000",type:"field_colour",name:"56"},{colour:"#000000",type:"field_colour",name:"57"},{colour:"#000000",type:"field_colour",name:"58"},{colour:"#000000",type:"field_colour",name:"59"},{colour:"#000000",type:"field_colour",name:"5a"},{colour:"#000000",type:"field_colour",name:"5b"},{colour:"#000000",type:"field_colour",name:"5c"},{colour:"#000000",type:"field_colour",name:"5d"},{colour:"#000000",type:"field_colour",name:"5e"},{colour:"#000000",type:"field_colour",name:"5f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"60"},{colour:"#000000",type:"field_colour",name:"61"},{colour:"#000000",type:"field_colour",name:"62"},{colour:"#000000",type:"field_colour",name:"63"},{colour:"#000000",type:"field_colour",name:"64"},{colour:"#000000",type:"field_colour",name:"65"},{colour:"#000000",type:"field_colour",name:"66"},{colour:"#000000",type:"field_colour",name:"67"},{colour:"#000000",type:"field_colour",name:"68"},{colour:"#000000",type:"field_colour",name:"69"},{colour:"#000000",type:"field_colour",name:"6a"},{colour:"#000000",type:"field_colour",name:"6b"},{colour:"#000000",type:"field_colour",name:"6c"},{colour:"#000000",type:"field_colour",name:"6d"},{colour:"#000000",type:"field_colour",name:"6e"},{colour:"#000000",type:"field_colour",name:"6f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"70"},{colour:"#000000",type:"field_colour",name:"71"},{colour:"#000000",type:"field_colour",name:"72"},{colour:"#000000",type:"field_colour",name:"73"},{colour:"#000000",type:"field_colour",name:"74"},{colour:"#000000",type:"field_colour",name:"75"},{colour:"#000000",type:"field_colour",name:"76"},{colour:"#000000",type:"field_colour",name:"77"},{colour:"#000000",type:"field_colour",name:"78"},{colour:"#000000",type:"field_colour",name:"79"},{colour:"#000000",type:"field_colour",name:"7a"},{colour:"#000000",type:"field_colour",name:"7b"},{colour:"#000000",type:"field_colour",name:"7c"},{colour:"#000000",type:"field_colour",name:"7d"},{colour:"#000000",type:"field_colour",name:"7e"},{colour:"#000000",type:"field_colour",name:"7f"}],output:"esp32_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:Rt.Msg.MIXLY_ESP32_Create_image}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)}},Y_={init:function(){var t=[[Rt.Msg.MIXLY_UP,"up"],[Rt.Msg.MIXLY_DOWN,"down"],[Rt.Msg.MIXLY_LEFT,"left"],[Rt.Msg.MIXLY_RIGHT,"right"]];this.setColour(O_),this.setOutput(!0),this.setInputsInline(!0),this.appendValueInput("img").appendField(Rt.Msg.DISPLAY_IMAGE_LET).setCheck(["esp32_image","List",String]),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:Rt.Msg.MIXLY_UP,down:Rt.Msg.MIXLY_DOWN,left:Rt.Msg.MIXLY_LEFT,right:Rt.Msg.MIXLY_RIGHT}[t]+s}))}},b_={init:function(){var t=[[Rt.Msg.MICROBIT_DISPLAY_UNION,"+"],[Rt.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(O_),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(Rt.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":Rt.Msg.MIXLY_MICROBIT_image_add,"-":Rt.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},k_={init:function(){this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING,"scroll"]]),"MODE"),this.jsonInit({colour:O_,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:Rt.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},x_={init:function(){this.setColour(O_),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},X_={init:function(){this.setColour(O_),this.appendValueInput("device").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_SETUP).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SETUP+Rt.Msg.MIXLY_DF_LCD+Rt.Msg.MIXLY_LCD_ADDRESS)}},G_={init:function(){this.setColour(O_),this.appendValueInput("row",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},H_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"on()"],[Rt.Msg.MIXLY_OFF,"off()"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(off)"],[Rt.Msg.MIXLY_LCD_BACKLIGHT,"backlight(on)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_DF_LCD+{"on()":Rt.Msg.MIXLY_ON,"off()":Rt.Msg.MIXLY_OFF,"clear()":Rt.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":Rt.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},U_={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendValueInput("row").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO+"OLED").setCheck(Number),this.appendValueInput("column").appendField("X").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip()}},w_={init:function(){this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendValueInput("Text_line1","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.OLEDDISPLAY+Rt.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(O_),this.setTooltip(Rt.Msg.MIXLY_DF_LCD+Rt.Msg.OLEDDISPLAY+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING)}},B_={init:function(){var t=[[Rt.Msg.MIXLY_HEIGHT,"height"],[Rt.Msg.MIXLY_WIDTH,"width"]];this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE+{height:Rt.Msg.MIXLY_HEIGHT,width:Rt.Msg.MIXLY_WIDTH}[t]}))}},W_={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RECT).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_RECT,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"width"},{check:Number,type:"input_value",name:"height"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_OLED_RECT)}},K_={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_DISPLAY_RLINE,"hline"],[Rt.Msg.MIXLY_DISPLAY_VLINE,"vline"]]),"direction"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"length"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE)}},Q_={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE_ARBITRARILY,args0:[{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE_ARBIT)}},j_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS)}},q_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE),this.setInputsInline(!0),this.setOutput(!0,"esp32_image"),this.setTooltip(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE_TOOLTIP)}},J_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS)}},z_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE)}},Z_={init:function(){this.setColour(O_),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").appendField(Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS).appendField(new Rt.FieldColour("#f00",null,R_),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},$_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},tr={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},er={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_DELAY)}},ir={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SCROLL_IMAGE_OR_STRING_DELAY)}},nr={init:function(){this.setColour(O_),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"ON"],[Rt.Msg.MIXLY_ESP32_OFF,"OFF"]]),"ONOFF"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},sr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:Rt.Msg.MIXLY_LCD_STAT_CLEAR,1:Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return Rt.Msg.MIXLY_DF_LCD+i[e]}))}},or={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["TM1650","TM1650"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{TM1650:"TM1650"}[e]}))}},pr={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"_on"],[Rt.Msg.MIXLY_OFF,"_off"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"_clear"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_power)}},ur={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("VALUE").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_NUMBER),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ar={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("NO").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER1),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER2+Rt.Msg.MIXLY_4DIGITDISPLAY_DOT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_showDot)}},lr={init:function(){this.setColour(O_),this.setOutput(!0,"Tuple"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISPLAY_ANIMATE).appendField(new Rt.FieldDropdown([["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]]),"ANIMATION")}},_r={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_CIRCLE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"r"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)}},rr={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_triangle,args0:[{check:Number,type:"input_value",name:"x0"},{check:Number,type:"input_value",name:"y0"},{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE)}},dr={init:function(){this.setColour("#555555"),this.appendDummyInput("").appendField(Rt.Msg.MIXGO_ONBOARDDISPLAY_HELP),this.setInputsInline(!0),this.setTooltip("")}},Ir={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.OLED_BITMAP),this.appendValueInput("START_X",Number).appendField(Rt.Msg.OLED_START_X).setCheck(Number),this.appendValueInput("START_Y",Number).appendField(Rt.Msg.OLED_START_Y).setCheck(Number),this.appendValueInput("bitmap_name",String).appendField(Rt.Msg.OLED_BITMAP_NAME),this.appendValueInput("WIDTH",Number).appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("HEIGHT",Number).appendField(Rt.Msg.MIXLY_HEIGHT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_SHOW_BMP_TOOLTIP)}},Tr={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED),this.appendDummyInput("").appendField(Rt.Msg.OLED_DRAWPIXEL),this.appendValueInput("POS_X").appendField(Rt.Msg.OLED_POSX),this.appendValueInput("POS_Y").appendField(Rt.Msg.OLED_POSY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_DRAW_PIXE_TOOLTIP)}},hr={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["32x12 Matrix","32x12 Matrix"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},cr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Or="#526FC3",Rr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_CONNECT_WIFI),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},Mr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},Er={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Cr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Ar={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},gr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Sr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Dr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Nr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},fr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_WIFI_USERNAME).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_IOT_PASSWORD).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_PROJECT).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Rt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Fr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_SUBSCRIBE+Rt.Msg.MIXLY_MICROBIT_MSG).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Rt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},vr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Yr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},br={init:function(){this.setColour(Or),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},kr={init:function(){this.setColour(Or),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},xr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Xr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Rt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Gr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+Rt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ur={init:function(){this.VISITOR_ID=Mt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Or),this.appendDummyInput("").appendField(new Rt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},wr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Br={init:function(){this.setColour(Or),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Rt.Msg.MIXLY_REQUESTS_GET).appendField(Rt.Msg.MIXLY_GET_CURRENT_TIME).appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Rt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Rt.Msg.MQTT_Topic).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},jr=Rr,qr=Mr,Jr=Er,zr=Cr,Zr=gr;Rt.Msg.PS2_TRIANGLE,Rt.Msg.PS2_CIRCLE,Rt.Msg.PS2_CROSS,Rt.Msg.PS2_SQUARE,Rt.Msg.PS2_L1,Rt.Msg.PS2_L2,Rt.Msg.PS2_R1,Rt.Msg.PS2_R2,Rt.Msg.PS2_UP,Rt.Msg.PS2_RIGHT,Rt.Msg.PS2_DOWN,Rt.Msg.PS2_LEFT,Rt.Msg.PS2_SELECT,Rt.Msg.PS2_START;const $r=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC);return"music.pitch("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+")\n"},td=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC),n=e.valueToCode(this,"time",e.ORDER_ATOMIC);return"music.pitch_time("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+", "+n+")\n"},ed=function(t,e){return e.definitions_.import_music="import music","music.stop("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")\n"},id=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"BPM",e.ORDER_ASSIGNMENT);return"music.set_tempo("+e.valueToCode(this,"TICKS",e.ORDER_ASSIGNMENT)+", "+i+")\n"},nd=function(t,e){e.definitions_.import_music="import music";return["music.get_tempo()",e.ORDER_ATOMIC]},sd=function(t,e){return e.definitions_.import_music="import music","music.pitch("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+")\n"},od=function(t,e){return e.definitions_.import_music="import music","music.pitch_time("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"time",e.ORDER_ATOMIC)+")\n"},pd=function(t,e){e.definitions_.import_music="import music";return"music.stop()\n"},ud=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+")\n"},ad=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},ld=function(t,e){return e.definitions_.import_music="import music",e.definitions_.import_matrix="import matrix","music.play_show("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},_d=function(t,e){return e.definitions_.import_music="import music","music.reset()\n"},rd=function(t,e){return e.definitions_.import_servo="import servo",e.definitions_.import_machine="import machine","servo.servo_write_angle("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DEGREE",e.ORDER_ATOMIC)+")\n"},dd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Id=function(t,e){return[this.getFieldValue("flag"),e.ORDER_ATOMIC]},Td=function(t,e){e.definitions_.import_mixgo="import mixgo";var i=e.valueToCode(this,"bright",e.ORDER_ATOMIC);return"mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setonoff("+i+")\n"},hd=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").getonoff()",e.ORDER_ATOMIC]},md=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},cd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setonoff("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},Od=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".getonoff()",e.ORDER_ATOMIC]},Rd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},Md=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=e.valueToCode(this,"LEDCOUNT",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",i+" = neopixel.NeoPixel(machine.Pin("+n+"), "+s+", timing = True)\n"},Ed=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".write()\n"},Cd=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},Ad=function(t,e){e.definitions_.import_mixgo="import mixgo";return"mixgo.rgb.write()\n"},gd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},Sd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb.fill(("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+"))\n"},Dd=cd,Nd=Od,fd=Rd,Ld=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC);e.functions_["terminal_widget_vpin_"+i]=`\nALLOWED_COMMANDS_LIST = ['ls', 'lsusb', 'ip a', 'ip abc']\n\n@blynk.handle_event('write V${i}')\ndef write_handler(pin, _values):\n header = ''\n result = ''\n delimiter = '{}\\n'.format('=' * 30)\n if _values and _values[0] in ALLOWED_COMMANDS_LIST:\n cmd_params = _values[0].split(' ')\n try:\n result = subprocess.check_output(cmd_params).decode('utf-8')\n header = '[output]\\n'\n except subprocess.CalledProcessError as exe_err:\n header = '[error]\\n'\n result = 'Return Code: {}\\n'.format(exe_err.returncode)\n except Exception as g_err:\n print("Command caused '{}'".format(g_err))\n elif _values and _values[0] == 'help':\n header = '[help -> allowed commands]\\n'\n result = '{}\\n'.format('\\n'.join(ALLOWED_COMMANDS_LIST))\n\n # communicate with terminal if help or some allowed command\n if result:\n output = '{}{}{}{}'.format(header, delimiter, result, delimiter)\n print(output)\n blynk.virtual_write(pin, output)\n blynk.virtual_write(pin, '\\n')\n`;return""},Fd=function(t,e){return"blynk.virtual_sync("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+")\n"},vd=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_disconnected="@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n"+i,""},Pd=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_connected="@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n"+i,""},Vd=function(){return"blynk_timer.run()\n"},yd=function(){return"blynk.run()\n"},Yd=function(t,e){return"blynk.notify("+e.valueToCode(this,"notification",e.ORDER_ATOMIC)+")\n"},bd=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";var i=e.valueToCode(this,"timer_num",e.ORDER_ATOMIC);return`blynk_timer.stop('${i}_blynk_timer${i}')\n`},kd=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";return["blynk_timer.get_timers()",e.ORDER_ATOMIC]},xd=function(t,e){e.definitions_.import_blynktimer="import blynktimer";var i=e.valueToCode(this,"Num",e.ORDER_ATOMIC),n=e.valueToCode(this,"period",e.ORDER_ATOMIC),s=this.getFieldValue("Timer_mode"),o=e.statementToCode(this,"DO");return o=e.addLoopTrap(o,this.id)||e.PASS,e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)",e.definitions_["blynktimer_event"+i]=`\n@blynk_timer.register(interval=${n}, run_once=${s})\ndef blynk_timer${i}():\n`+o,""},Xd=function(t,e){var i=e.valueToCode(this,"sensor_data",e.ORDER_ATOMIC);return"blynk.virtual_write("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+", "+i+")\n"},Gd=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC),n=e.statementToCode(this,"DO");return n=e.addLoopTrap(n,this.id)||e.PASS,e.definitions_["blynk_VIRTUAL_WRITE_"+i]="@blynk.handle_event('write V"+i+"')\ndef write_virtual_pin_handler(pin, _value):\n for i in range(0, len(_value)):\n try: _value[i] = eval(_value[i])\n except: pass\n if len(_value) == 1: _value = _value[0]\n"+n,""},Hd=function(t,e){var i=e.valueToCode(this,"body",e.ORDER_ATOMIC),n=e.valueToCode(this,"subject",e.ORDER_ATOMIC);return`blynk.email(${e.valueToCode(this,"TargetEmail",e.ORDER_ATOMIC)}, ${n}, ${i})\n`},Ud=function(t,e){var i=e.valueToCode(this,"attribute_value",e.ORDER_ATOMIC);return`blynk.set_property(pin, ${e.valueToCode(this,"attribute_name",e.ORDER_ATOMIC)}, ${i})\n`},wd=function(t,e){e.definitions_.import_BlynkLib="import blynklib";var i=e.valueToCode(this,"server",e.ORDER_ATOMIC),n=e.valueToCode(this,"auth",e.ORDER_ATOMIC),s=e.valueToCode(this,"port",e.ORDER_ATOMIC);return e.definitions_.mpython_blynk_setup="blynk = blynklib.Blynk("+n+", server="+i+", port="+s+")",e.definitions_.blynk_on_connected="\n@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n",e.definitions_.blynk_on_disconnected="\n@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n",""};const Bd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Wd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Kd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.showstatic("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Qd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},jd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},qd=function(t,e){e.definitions_.import_matrix="import matrix";var i={"#000000":"0","#ff0000":"1"};return['matrix.Image("'+i[t.getFieldValue("00")]+i[t.getFieldValue("01")]+i[t.getFieldValue("02")]+i[t.getFieldValue("03")]+i[t.getFieldValue("04")]+i[t.getFieldValue("05")]+i[t.getFieldValue("06")]+i[t.getFieldValue("07")]+i[t.getFieldValue("08")]+i[t.getFieldValue("09")]+i[t.getFieldValue("0a")]+i[t.getFieldValue("0b")]+i[t.getFieldValue("0c")]+i[t.getFieldValue("0d")]+i[t.getFieldValue("0e")]+i[t.getFieldValue("0f")]+":"+i[t.getFieldValue("10")]+i[t.getFieldValue("11")]+i[t.getFieldValue("12")]+i[t.getFieldValue("13")]+i[t.getFieldValue("14")]+i[t.getFieldValue("15")]+i[t.getFieldValue("16")]+i[t.getFieldValue("17")]+i[t.getFieldValue("18")]+i[t.getFieldValue("19")]+i[t.getFieldValue("1a")]+i[t.getFieldValue("1b")]+i[t.getFieldValue("1c")]+i[t.getFieldValue("1d")]+i[t.getFieldValue("1e")]+i[t.getFieldValue("1f")]+":"+i[t.getFieldValue("20")]+i[t.getFieldValue("21")]+i[t.getFieldValue("22")]+i[t.getFieldValue("23")]+i[t.getFieldValue("24")]+i[t.getFieldValue("25")]+i[t.getFieldValue("26")]+i[t.getFieldValue("27")]+i[t.getFieldValue("28")]+i[t.getFieldValue("29")]+i[t.getFieldValue("2a")]+i[t.getFieldValue("2b")]+i[t.getFieldValue("2c")]+i[t.getFieldValue("2d")]+i[t.getFieldValue("2e")]+i[t.getFieldValue("2f")]+":"+i[t.getFieldValue("30")]+i[t.getFieldValue("31")]+i[t.getFieldValue("32")]+i[t.getFieldValue("33")]+i[t.getFieldValue("34")]+i[t.getFieldValue("35")]+i[t.getFieldValue("36")]+i[t.getFieldValue("37")]+i[t.getFieldValue("38")]+i[t.getFieldValue("39")]+i[t.getFieldValue("3a")]+i[t.getFieldValue("3b")]+i[t.getFieldValue("3c")]+i[t.getFieldValue("3d")]+i[t.getFieldValue("3e")]+i[t.getFieldValue("3f")]+":"+i[t.getFieldValue("40")]+i[t.getFieldValue("41")]+i[t.getFieldValue("42")]+i[t.getFieldValue("43")]+i[t.getFieldValue("44")]+i[t.getFieldValue("45")]+i[t.getFieldValue("46")]+i[t.getFieldValue("47")]+i[t.getFieldValue("48")]+i[t.getFieldValue("49")]+i[t.getFieldValue("4a")]+i[t.getFieldValue("4b")]+i[t.getFieldValue("4c")]+i[t.getFieldValue("4d")]+i[t.getFieldValue("4e")]+i[t.getFieldValue("4f")]+":"+i[t.getFieldValue("50")]+i[t.getFieldValue("51")]+i[t.getFieldValue("52")]+i[t.getFieldValue("53")]+i[t.getFieldValue("54")]+i[t.getFieldValue("55")]+i[t.getFieldValue("56")]+i[t.getFieldValue("57")]+i[t.getFieldValue("58")]+i[t.getFieldValue("59")]+i[t.getFieldValue("5a")]+i[t.getFieldValue("5b")]+i[t.getFieldValue("5c")]+i[t.getFieldValue("5d")]+i[t.getFieldValue("5e")]+i[t.getFieldValue("5f")]+":"+i[t.getFieldValue("60")]+i[t.getFieldValue("61")]+i[t.getFieldValue("62")]+i[t.getFieldValue("63")]+i[t.getFieldValue("64")]+i[t.getFieldValue("65")]+i[t.getFieldValue("66")]+i[t.getFieldValue("67")]+i[t.getFieldValue("68")]+i[t.getFieldValue("69")]+i[t.getFieldValue("6a")]+i[t.getFieldValue("6b")]+i[t.getFieldValue("6c")]+i[t.getFieldValue("6d")]+i[t.getFieldValue("6e")]+i[t.getFieldValue("6f")]+":"+i[t.getFieldValue("70")]+i[t.getFieldValue("71")]+i[t.getFieldValue("72")]+i[t.getFieldValue("73")]+i[t.getFieldValue("74")]+i[t.getFieldValue("75")]+i[t.getFieldValue("76")]+i[t.getFieldValue("77")]+i[t.getFieldValue("78")]+i[t.getFieldValue("79")]+i[t.getFieldValue("7a")]+i[t.getFieldValue("7b")]+i[t.getFieldValue("7c")]+i[t.getFieldValue("7d")]+i[t.getFieldValue("7e")]+i[t.getFieldValue("7f")]+'")',e.ORDER_ATOMIC]},Jd=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.Image."+t.getFieldValue("image"),e.ORDER_ATOMIC]},zd=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.get_pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},Zd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},$d=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_brightness()",e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_screenimage()",e.ORDER_ATOMIC]},eI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},iI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.blink_rate("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},nI=function(t,e){e.definitions_.import_matrix="import matrix";return"matrix.clear()\n"},sI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},oI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},pI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},uI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),p=e.valueToCode(this,"height",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP"),l="";switch(u){case"True":l=i+".show_fill_rect("+n+", "+s+", "+o+", "+p+","+a+")\n";break;case"False":l=i+".show_rect("+n+", "+s+", "+o+", "+p+","+a+")\n"}return l},aI=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP"),n=e.valueToCode(t,"A",e.ORDER_ATOMIC),s=e.valueToCode(t,"B",e.ORDER_ATOMIC);return["INTERSECTION"==i?n+"-("+n+"-"+s+")":n+i+s,e.ORDER_ATOMIC]},lI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},_I=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},rI=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dI=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},II=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},TI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+this.getFieldValue("STAT")+"()\n"},hI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_num("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},mI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_dot("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},cI=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},OI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",u=this.getFieldValue("OP"),a="";switch(p){case"True":a=i+".show_fill_circle("+n+", "+s+", "+o+", "+u+")\n";break;case"False":a=i+".show_circle("+n+", "+s+", "+o+", "+u+")\n"}return a},RI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),p=e.valueToCode(this,"y1",e.ORDER_ATOMIC),u=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),l="TRUE"==this.getFieldValue("fill")?"True":"False",_=this.getFieldValue("OP"),r="";switch(l){case"True":r=i+".show_fill_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n";break;case"False":r=i+".show_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n"}return r},MI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},EI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},CI=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=n+" = matrix32x12.Matrix("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},AI=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_matrix32x12="import matrix32x12",i+".set_buffer("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},gI=function(t,e){return e.definitions_.import_matrix32x12="import matrix32x12",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},SI=function(t,e){return e.definitions_.import_mixiot="import mixiot","mixiot.wlan_connect("+e.valueToCode(this,"WIFINAME",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+")\n"},DI=function(t,e){return e.definitions_.import_onenet="import onenet",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+" = onenet.init_MQTT_client("+e.valueToCode(this,"CLIENT",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SERVER",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC)+", "+(e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)||"None")+")\n"},NI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".do_disconnect()\n"},fI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"DICT",e.ORDER_ATOMIC),s="TRUE"==this.getFieldValue("is_print")?"True":"False";return e.definitions_.import_onenet="import onenet",i+".publish("+n+", is_print = "+s+")\n"},LI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".check_msg()\n"},FI=function(t,e){e.definitions_.import_onenet="import onenet";var i=new Array(this.itemCount_),n=new Array(this.itemCount_),s=new Array(this.itemCount_),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);for(let t=0;te?t[e]:"ni-hao"),"KEY"+e).appendField("”:")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mm={init:function(){this.setColour(cm),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("启动识别 返回结果"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("语音识别,获取识别结果")}},Em={init:function(){this.setColour(cm),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("注销识别 内存释放"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("语音识别,注销语音识别,释放内存")}},Cm="#90A244",Am={init:function(){this.setColour(Cm),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["否","0"],["是","1"]]),"flag"),this.setOutput(!0),this.setTooltip()}},gm={init:function(){this.setColour(Cm),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("path").appendField("打开路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("打开一个新的图像对象")}},Sm={init:function(){this.setColour(Cm),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField("打开空图"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开一个空的图像对象")}},Dm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像信息"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["宽度","width"],["高度","height"],["格式","format"],["大小","size"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取图像的宽度、高度、格式、大小")}},Nm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像保存"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("图像的副本保存到文件系统")}},fm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像截取"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("复制一个图像图像的副本")}},Lm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB"),this.appendDummyInput().appendField("["),this.appendValueInput("R").setCheck(Number),this.appendValueInput("G").appendField(",").setCheck(Number),this.appendValueInput("B").appendField(",").setCheck(Number),this.appendDummyInput().appendField("]"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("对图像进行适当压缩")}},Fm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像压缩"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("quality").setAlign(Rt.inputs.Align.RIGHT).appendField("压缩率").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("对图像进行适当压缩")}},vm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像清除"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("将图像中的所有像素设置为零")}},Pm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像转换"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("转换为").appendField(new Rt.FieldDropdown([["灰度图","to_grayscale"],["彩色图","to_rgb565"],["彩虹图","to_rainbow"],["AI格式","pix_to_ai"],["字节块","to_bytes"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("将图像转换为灰度图、彩色图、彩虹图像")}},Vm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("修改点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("设置图像某点像素值")}},ym={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("获取点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("获取图像某点像素值")}},Ym={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("字库加载"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("从SD中加载需要显示文字的字库")}},bm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("字库释放"),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("释放字库所占的内存")}},km={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本(中)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个文本")}},xm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个中文文本")}},Xm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本(英)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个字符文本")}},Gm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制直线"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一条从(x0,y0)到(x1,y1)的线")}},Hm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制箭头"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个箭头")}},Um={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制十字"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("延伸").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个十字")}},wm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制圆形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyr"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个圆形")}},Bm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制矩形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xywh"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个矩形")}},Wm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制特征点"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("对象"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setTooltip("绘制一个特征点对象的各个点")}},Km={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制图像"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("x_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("x缩放").setCheck(Number),this.appendValueInput("y_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("y缩放").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("绘制一个image图像")}},Qm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直线识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("theta_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendValueInput("rho_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并斜率").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别直线,返回image.line对象列表")}},jm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("线段识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("distance").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.appendValueInput("difference").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别线段,返回image.line对象列表")}},qm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("圆形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("r_min").setAlign(Rt.inputs.Align.RIGHT).appendField("最小r").setCheck(Number),this.appendValueInput("r_max").setAlign(Rt.inputs.Align.RIGHT).appendField("最大r").setCheck(Number),this.appendValueInput("r_step").setAlign(Rt.inputs.Align.RIGHT).appendField("步长r").setCheck(Number),this.appendValueInput("x_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并x值").setCheck(Number),this.appendValueInput("y_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并y值").setCheck(Number),this.appendValueInput("r_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并r值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[circle]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别圆形,返回image.cirle对象列表")}},Jm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("矩形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[rect]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用四元检测识别矩形,返回image.rect对象列表")}},zm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("线性回归"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("robust").setAlign(Rt.inputs.Align.RIGHT).appendField("泰尔指数").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("计算线性回归,返回image.line对象列表")}},Zm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直线解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","line"],["x1分量","x1"],["y1分量","y1"],["x2分量","x2"],["y2分量","y2"],["长度","length"],["角度","theta"],["斜率","rho"],["模","magnitude"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.line列表,获取直线信息")}},$m={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("圆形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xyr","circle"],["x分量","x"],["y分量","y"],["r分量","r"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.circle列表,获取圆形信息")}},tc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("矩形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.rect列表,获取矩形信息")}},ec={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直方图均衡"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("limit").setAlign(Rt.inputs.Align.RIGHT).appendField("对比度").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单直方图均衡化")}},ic={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("模糊滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("offset").setAlign(Rt.inputs.Align.RIGHT).appendField("补偿").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单模糊滤波")}},nc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("卡通化滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单卡通滤波器")}},sc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像腐蚀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像腐蚀,从分割区域的边缘删除像素(白色目标区域)")}},oc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像膨胀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像膨胀,将像素添加到分割区域的边缘中(白色目标区域)")}},pc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像填充"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("开始坐标"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("反转"),this.appendValueInput("clear").setAlign(Rt.inputs.Align.RIGHT).appendField("清除"),this.setOutput(!0),this.setTooltip("像洪水一样填充图像中低矮凹陷的地方(洪水填充)")}},uc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像投影"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("垂直投影"),this.setOutput(!0),this.setTooltip("图像从笛卡尔坐标到线性极坐标重新投影")}},ac={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像反转"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("翻转图像中的所有像素值")}},lc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("校正缩放"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendValueInput("strength").appendField("校正值").setCheck(Number),this.appendValueInput("zoom").appendField("缩放值").setCheck(Number),this.setOutput(!0),this.setTooltip("翻转图像中的所有像素值")}},_c={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像二值化"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("zero").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值像素为零"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("根据像素是否在阈值列表 thresholds 中的阈值内,将图像中的所有像素设置为黑色或白色。")}},rc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像边缘检测"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("kernel").setAlign(Rt.inputs.Align.RIGHT).appendField("内核"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("通过过滤器内核对图像进行卷积。")}},dc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("条形码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[barcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setOutput(!0),this.setTooltip("使用条形码识别,返回image.barcode对象列表")}},Ic={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("二维码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[qrcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用二维码识别,返回image.line对象列表")}},Tc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("AprilTag识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[apriltag]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用image.TAG36H11识别,返回image.apriltag对象列表")}},hc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("二维码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["版本","version"],["掩码","mask"],["类型","data_type"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.qrcode列表,获取二维码信息")}},mc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("条形码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["类型","type"],["角度","rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},cc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("AprilTag解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["号码","id"],["家族","family"],["弧度","rotation"],["x向距离","x_translation"],["y向距离","y_translation"],["z向距离","z_translation"],["x向弧度","x_rotation"],["y向弧度","y_rotation"],["z向弧度","z_rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.apriltag列表,获取Apriltag信息")}},Oc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色块追踪"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值LAB"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("area").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉区域").setCheck(Number),this.appendValueInput("pixel").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉素数").setCheck(Number),this.appendValueInput("margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("重叠"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[blob]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用色块追踪,返回image.blob对象列表")}},Rc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("颜色识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[histogram]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用直方图识别颜色,返回image.histogram对象列表")}},Mc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("追踪解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["像素量","pixels"],["弧度","rotation"],["号码数","code"],["合并量","count"],["面积","area"],["密度比","density"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.blob列表,获取追踪色块信息")}},Ec={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色阈浮点"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图浮点列表","bins"],["LAB的L浮点列表","l_bins"],["LAB的A浮点列表","a_bins"],["LAB的B浮点列表","b_bins"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},Cc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("颜色解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendValueInput("percentile").appendField("CDF").setCheck(Number),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过histogram列表,获取识别颜色信息")}},Ac={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色阈解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},gc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB888值"),this.appendValueInput("LIST").appendField("由LAB"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("LAB转RGB888")}},Sc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("LAB值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转LAB")}},Dc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("灰度值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转灰度图")}},Nc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB888"),this.appendValueInput("g_value").appendField("由灰度值").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("灰度图转RGB888")}},fc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("定向梯度图"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("线长").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("用HOG(定向梯度直方图)线替换ROI中的像素,仅支持灰度图像")}},Lc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("max_keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("关键点数").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("角点数").setCheck(Number),this.appendValueInput("scale_factor").setAlign(Rt.inputs.Align.RIGHT).appendField("比例因子").setCheck(Number),this.appendValueInput("normalized").setAlign(Rt.inputs.Align.RIGHT).appendField("多比例"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[keypoints]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},Fc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征比较"),this.appendValueInput("VAR1").setAlign(Rt.inputs.Align.RIGHT).appendField("对象1").setCheck("var"),this.appendValueInput("VAR2").setAlign(Rt.inputs.Align.RIGHT).appendField("对象2").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("相似度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[kptmatch]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},vc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征信息"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["匹配量","count"],["弧度","theta"],["匹配点-xy","match"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.kptmatch列表,获取追踪特征信息")}},Pc=20,Vc={init:function(){this.setColour(Pc),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_HIGH,"HIGH"],[Rt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},yc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("初始化 "),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_Digital_PINMODEOUT,"GPIO.OUT"],[Rt.Msg.MIXLY_Digital_PINMODEIN,"GPIO.IN"],[Rt.Msg.MIXLY_PINMODEPULLUP,"GPIO.IN, board.GPIO.PULL_UP"],[Rt.Msg.MIXLY_PINMODEPULLDOWN,"GPIO.IN, board.GPIO.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)}},Yc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},bc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField("值"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},kc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("初始化 PWM输出"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("freq").appendField("频率").setCheck(Number),this.appendValueInput("VAR").appendField("定时器").setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化PWM输出设置,需要调用定时器")}},xc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField("PWM输出").setCheck(Number),this.appendValueInput("pwm").appendField("占空比").setCheck(Number),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("PWM输出,值范围为0-100%,可以为小数")}},Xc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("硬件中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_RISING,"GPIO.IRQ_RISING"],[Rt.Msg.MIXLY_FALLING,"GPIO.IRQ_FALLING"],[Rt.Msg.MIXLY_CHANGE,"GPIO.IRQ_BOTH"]]),"mode"),this.appendValueInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Gc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("取消中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("取消中断")}},Hc="#637AAC",Uc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField("OneNET 连接WiFi"),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},wc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},Bc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Wc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Kc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},Qc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zc=Uc,Zc=wc,$c=Bc,tO=Wc,eO=Qc,iO=230;Rt.FieldTextInput.math_number_validator=function(t){return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const nO={init:function(){this.setColour(iO),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},sO={init:function(){this.setColour(iO);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},oO={init:function(){this.setColour(iO),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},pO={init:function(){this.setColour(iO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},uO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},aO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},lO={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(iO),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},_O={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(iO),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},rO={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(iO),this.appendValueInput("LIST").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},dO={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(iO),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},IO={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(iO),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},TO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},hO={init:function(){this.setColour(iO),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},mO={init:function(){this.setColour(iO),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},cO={init:function(){this.setColour(iO),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},OO=hO,RO="#2E9883",MO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("PS2手柄"),this.appendValueInput("miso_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("DAT#").setCheck(Number),this.appendValueInput("mosi_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CMD#").setCheck(Number),this.appendValueInput("cs_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("SEL#").setCheck(Number),this.appendValueInput("clk_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CLK#").setCheck(Number),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用PS2手柄控制")}},EO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("UART键盘"),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用串口键盘控制")}},CO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 运行游戏"),this.appendValueInput("path").appendField("路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("运行NES游戏ROM")}},AO="#5B6DA5",gO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("ESP-AT 初始化"),this.appendValueInput("RX",Number).appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("使用串口连接ESP-AT设备,并初始化配置")}},SO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi扫描"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("扫描附近可用的WiFi信息-返回多信息列表")}},DO={init:function(){this.setColour(AO),this.appendDummyInput("").appendField("WiFi连接"),this.appendValueInput("account").appendField("名称").setCheck(String),this.appendValueInput("password").appendField("密码").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("配置WiFi名称及密码,连接WiFi上网")}},NO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi").appendField(new Rt.FieldDropdown([["连接信息","1"],["连接状态","2"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("查看wifi连接信息或者连接状态")}},fO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi断开连接"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("断开wifi连接")}},LO={init:function(){this.setColour(AO),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField("打开热点"),this.appendValueInput("account").setAlign(Rt.inputs.Align.RIGHT).appendField("名称").setCheck(String),this.appendValueInput("password").setAlign(Rt.inputs.Align.RIGHT).appendField("密码").setCheck(String),this.appendValueInput("chl").setAlign(Rt.inputs.Align.RIGHT).appendField("通道").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("加密").appendField(new Rt.FieldDropdown([["WPA2_PSK","WPA2_PSK"],["OPEN","OPEN"],["WPA_PSK","WPA_PSK"],["WPA_WPA2_PSK","WPA_WPA2_PSK"]]),"mode"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开WiFi热点并配置")}},FO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("关闭热点"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("关闭热点")}},vO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("套接字 初始化"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("套接字初始化")}},PO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("获取地址"),this.appendValueInput("addr").setAlign(Rt.inputs.Align.RIGHT).appendField("域名").setCheck(String),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接字根据域名解析地址IP信息")}},VO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("创建连接"),this.appendValueInput("address").appendField("地址"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接字创建目标IP地址连接")}},yO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("超时时间"),this.appendValueInput("time").setAlign(Rt.inputs.Align.RIGHT).appendField("").setCheck(Number),this.appendDummyInput().appendField("s"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("设置阻塞套接字超时时间")}},YO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendValueInput("content").appendField("发送数据"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接发送数据")}},bO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("接收数据"),this.appendValueInput("size").appendField("字节").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接接收数据,返回接收到的数据对象")}},kO={init:function(){this.setColour(AO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},xO=230,XO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital),"PIN"),this.setOutput(!0)}},GO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},HO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog),"PIN"),this.setOutput(!0)}},UO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},wO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac),"PIN"),this.setOutput(!0)}},BO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},WO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},KO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},QO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},jO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},qO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch),"PIN"),this.setOutput(!0)}},JO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},zO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},ZO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},$O={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},tR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},eR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},iR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},nR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},sR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},oR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},pR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},uR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},aR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},lR=40,_R={init:function(){this.setColour(lR),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["A","17"],["B","16"]]),"KEY"),this.setOutput(!0),this.setTooltip()}},rR={init:function(){this.setColour(lR),this.appendDummyInput().appendField("初始化"),this.appendValueInput("key").appendField("按键"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化按键")}},dR={init:function(){this.setColour(lR),this.appendValueInput("key").appendField("按键"),this.appendDummyInput().appendField("被按下?"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip("获取按键值")}},IR={init:function(){this.setColour(lR),this.appendDummyInput().appendField("DHT11"),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField("获取").appendField(new Rt.FieldDropdown([["温度-℃","0"],["湿度-%","1"],["温湿度","2"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("dht11,获取温湿度")}},TR={init:function(){this.setColour(lR),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CHAOSHENGBO),this.appendValueInput("PIN1",Number).appendField("Trig #").setCheck(Number),this.appendValueInput("PIN2",Number).appendField("Echo #").setCheck(Number),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_CHAOSHENGBO)}},hR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},mR={init:function(){this.setColour(lR),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("MPU9250","key");var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{MPU9250:"MPU9250",SHT20:"SHT20",BMP280:"BMP280",ADXL345:"ADXL345"}[e]}))}},cR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[Rt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},OR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[Rt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},RR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_GET+Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},MR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},ER={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_GETTEMPERATUE)}},CR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("ADXL345").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},AR=65,gR={init:function(){this.setColour(AR),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},SR={init:function(){this.setColour(AR),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_Huanhang_TOOLTIP+Rt.Msg.TEXT_PRINT_TOOLTIP)}},DR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.appendValueInput("CONTENT",Number).appendField(new Rt.FieldDropdown([[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_DEC,"int"],[Rt.Msg.MATH_HEX,"hex"]]),"STAT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setFieldValue("hex","STAT"),this.setTooltip(Rt.Msg.TEXT_PRINT_HEX_TOOLTIP)}},NR={init:function(){this.setColour(AR),this.appendValueInput("char_marker").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_WHEN_CONTAIN_DATA),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO)}},fR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_READSTR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_READ_STR)}},LR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_SERIAL_AVAILABLE1)}},FR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_ESP32_READ_LINE),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_READ_LINE1)}},vR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial "+Rt.Msg.MIXLY_SERIAL_READSTR_UNTIL).appendField(new Rt.FieldDropdown([["new line","serial.delimiters(Delimiters.NewLine)"],[",","serial.delimiters(Delimiters.Comma)"],["$","serial.delimiters(Delimiters.Dollar)"],[":","serial.delimiters(Delimiters.Colon)"],[".","serial.delimiters(Delimiters.Fullstop)"],["#","serial.delimiters(Delimiters.Hash)"]]),"char_marker"),this.setInputsInline(!0),this.setOutput(!0,String)}},PR={init:function(){this.setColour(AR),this.appendValueInput("RX",Number).appendField(Rt.Msg.MIXLY_SETUP).appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SERIAL_BEGIN).appendField(new Rt.FieldDropdown([["115200","115200"],["57600","57600"],["37400","38400"],["31250","31250"],["28800","28800"],["19200","19200"],["14400","14400"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["300","300"]]),"baudrate"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SERIAL_softserial)}},VR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Rt.Msg.INOUT_input_TOOLTIP)}},yR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.BLOCKPY_PRINT_TOOLTIP)}},YR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},bR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Rt.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},kR={init:function(){this.setColour(AR),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["system_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("system_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n {\n"+e.statementToCode(this,"do")+"})\n"},MS=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},ES=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},CS=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},AS=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},gS=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},SS=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},DS=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},NS=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},fS=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},LS=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},FS=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},vS=function(){return"while True:\n pass\n"},PS=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},VS=function(t,e){e.definitions_["import machine"]="import machine";return"machine.reset()\n"},yS=function(t,e){return e.definitions_["import gc"]="import gc",this.getFieldValue("gc")+"\n"},YS=function(t,e){return e.definitions_.import_os="import os","os.uname()"},bS=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},kS=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=i%3,s=parseInt(i/3),o=e.valueToCode(this,"period",e.ORDER_NONE);return"tim"+i+" =Timer(Timer.TIMER"+n+",Timer.CHANNEL"+s+",mode=Timer.MODE_"+this.getFieldValue("mode")+",period = "+o+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},xS=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},XS=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"tim"+i+" = Timer(Timer.TIMER"+i%3+",Timer.CHANNEL"+parseInt(i/3)+", mode=Timer.MODE_PWM)\n"},GS=XS,HS=kS,US=xS,wS=bS;const BS=function(t,e){return["["+this.getFieldValue("TEXT")+"]",e.ORDER_ATOMIC]},WS=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},KS=function(t,e){var i=this.getFieldValue("COLOR");return["("+("0x"+(i=i.substr(1)).substr(0,2))+","+("0x"+i.substr(2,2))+","+("0x"+i.substr(4,2))+")",e.ORDER_ATOMIC]},QS=function(t,e){var i=this.getFieldValue("COLOR");return[i=function(t){var e,i,n;e=(t=t.substr(1)).substr(0,2),i=t.substr(2,2),n=t.substr(4,2);var s=(64512&(t="0x"+(t=e+i+n)))>>10;return((248&t)>>3<<8)+((7&s)<<13)+((16252928&t)>>19<<3)+((56&s)>>3)}(i),e.ORDER_ATOMIC]};Object.assign(Rt.Variables,Ct),Object.assign(Rt.Procedures,es),Rt.Python=Al,Rt.generator=Al,Mt.Profile.default={},Object.assign(Mt.Profile,ZI),Object.assign(Mt.Profile.default,ZI.k210),Object.assign(Rt.Blocks,e,i,n,s,o,p,u,a,l,_,r,d,I,F,L,f,N,Y,b,k,x,X,G,H,U,w,B,W,K,Q,j,q,J,z,Z,$),Object.assign(Rt.Python.forBlock,T,h,m,c,O,R,M,E,C,A,g,S,D,y,V,P,v,tt,et,it,nt,st,ot,pt,ut,at,lt,_t,rt,dt,It,Tt,ht,mt,ct,Ot)})(); \ No newline at end of file +class At{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ut={init:function(){this.setColour(bt),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},wt={init:function(){this.setColour(bt),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Rt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Bt={init:function(){this.setColour(bt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Wt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Kt={init:function(){this.setColour(bt);var t=new Rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Bt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Kt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},$t={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},te={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},ee={init:function(){this.jsonInit({message0:Rt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:bt,tooltip:Rt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Rt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ie={init:function(){this.setColour(bt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_STAT),this.setOutput(!0)}},ne={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},se={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},oe={init:function(){this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Rt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Rt.FieldDropdown([[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(bt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},pe={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ue={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},ae={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},le={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET+Rt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_GET_UNIQUE_IDEN)}},_e={init:function(){this.setColour(bt),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},re=230;Rt.FieldTextInput.math_number_validator=function(t){return String(t)},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const de={init:function(){this.setColour(re),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Ie={init:function(){this.setColour(re);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Te={init:function(){this.setColour(re);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},he={init:function(){this.setColour(re),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},me={init:function(){this.setColour(re),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ce={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Oe={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Re={init:function(){var t=[[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_HEX,"hex"]];this.setColour(re),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Rt.Msg.MATH_DEC_TOOLTIP_BIN,oct:Rt.Msg.MATH_DEC_TOOLTIP_OCT,hex:Rt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Me={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(re),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ee={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(re),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ce={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(re),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ae={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(re),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},ge={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},Se={init:function(){this.setColour(re),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},De={init:function(){this.setColour(re),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Ne={init:function(){this.setColour(re),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},fe={init:function(){this.setColour(re),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MATH_ROUND).appendField(Rt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Rt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Le={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"],[Rt.Msg.MIXLY_TO_BITES,"b"],[Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(re),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Fe={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(re),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ve=Se,Pe={init:function(){this.setColour(re),this.appendValueInput("VAR").appendField(Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ve={init:function(){this.setColour(re),this.itemCount_=1,this.setMutator(new Rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Rt.Msg.MIXLY_PRODUCT+Rt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Rt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ke={init:function(){this.setColour(ye),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Rt.FieldTextInput("",Rt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Rt.FieldImage(e,7,12,'"')}},xe={init:function(){this.setColour(ye),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Rt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Xe={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ge={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(String).appendField(Rt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},He={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ue={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},we={init:function(){this.WHERE_OPTIONS=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.TEXT_GET_INDEX_RANDOM+1+Rt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.LISTS_GET_INDEX_GET,"MODE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Rt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+Rt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Rt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:Rt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Rt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Rt.Msg.TEXT_GET_INDEX_RANDOM};return Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+Rt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Rt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Rt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Be={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.LISTS_GET_INDEX_FROM_START+"n"+Rt.Msg.TEXT_CHARAT2)}},We={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Rt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Rt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ke={init:function(){this.WHERE_OPTIONS_1=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Rt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new Rt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Qe={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},je={init:function(){var t=[[Rt.Msg.MIXLY_EQUALS,"==="],[Rt.Msg.MIXLY_STARTSWITH,"startswith"],[Rt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ye),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Rt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},qe={init:function(){this.setColour(ye),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_COMPARETO_HELP)}},Je={init:function(){var t=[[Rt.Msg.TEXT_UPPER,"upper"],[Rt.Msg.TEXT_TITLE,"title"],[Rt.Msg.TEXT_CAPITALIZE,"capitalize"],[Rt.Msg.TEXT_SWAPCASE,"swapcase"],[Rt.Msg.TEXT_LOWER,"lower"]];this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Rt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Rt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Rt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Rt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Rt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Rt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ze={init:function(){var t=[[Rt.Msg.TEXT_LJUST,"ljust"],[Rt.Msg.TEXT_CENTER,"center"],[Rt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ye),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Rt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ze={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Rt.Msg.MIXLY_MID+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Rt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},$e={init:function(){this.setColour(ye),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},ti={init:function(){this.setColour(ye),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Rt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},ei={init:function(){this.setColour(ye),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Rt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Rt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ii={init:function(){var t=[[Rt.Msg.TEXT_TRIM_BOTH,"strip"],[Rt.Msg.TEXT_TRIM_LEFT,"lstrip"],[Rt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ye),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Rt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Rt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Rt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ni={init:function(){this.setColour(ye),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Rt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Zi={init:function(){this.setColour(Ji),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},$i={init:function(){this.setColour(Ji),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},tn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_KEYS),this.setTooltip(Rt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},en={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_TOOLTIP)}},nn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},sn={init:function(){this.setColour(Ji),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},on={init:function(){this.setColour(Ji),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_DELETE_TOOLTIP)}},pn={init:function(){this.setColour(Ji),this.appendValueInput("DICT2").setCheck("Dict").appendField(Rt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Rt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MID),this.setTooltip(Rt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},un={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_CLEAR),this.setTooltip(Rt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},an={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_ITEMS),this.setTooltip(Rt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},ln={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_VALUES),this.setTooltip(Rt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},_n={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_LENGTH),this.setTooltip(Rt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},rn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_DELDICT),this.setTooltip(Rt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dn={init:function(){this.MODE=[[Rt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Rt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Rt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Rt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Rt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Rt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},In={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setTooltip(Rt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Tn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},hn={init:function(){this.setColour(Ji),this.appendDummyInput("").appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Rt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mn={init:function(){this.setColour(Ji),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},cn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},On={init:function(){this.setColour(Ji),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Rn={init:function(){this.setColour(Ji),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Mn=210,En={init:function(){var t=Rt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Cn={init:function(){var t=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Rt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},An={init:function(){var t=[[Rt.Msg.LOGIC_OPERATION_AND,"AND"],[Rt.Msg.LOGIC_OPERATION_OR,"OR"],[Rt.Msg.LOGIC_OPERATION_NOR,"NOR"],[Rt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Rt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},gn={init:function(){this.setColour(Mn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Rt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Rt.Msg.LOGIC_NEGATE_TOOLTIP)}},Sn={init:function(){var t=[[Rt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Rt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Mn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Rt.FieldDropdown(t),"BOOL"),this.setTooltip(Rt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Dn={init:function(){this.setColour(Mn),this.setOutput(!0),this.appendDummyInput().appendField(Rt.Msg.LOGIC_NULL),this.setTooltip(Rt.Msg.LOGIC_NULL_TOOLTIP)}},Nn={init:function(){this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Rt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Rt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},fn={init:function(){var t=[[Rt.Msg.TEXT_APPEND_TO,"in"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Rt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Rt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.IN)}},Ln={init:function(){var t=[[Rt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Mn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Fn={init:function(){this.setColour(Mn),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},vn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Rt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Vn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXPY_TEXT_ENCODE).appendField(new Rt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},Yn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MICROBIT_PYTHON_TYPE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.HTML_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Un={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const wn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Qn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},jn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Rt.Msg.MIXLY_ESP32_SET+{mkdir:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},qn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Rt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_FILE,"isfile"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Rt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$n={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Rt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},ts={};ts.NAME_TYPE=Rt.PROCEDURE_CATEGORY_NAME,ts.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Js={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_FORM_CONTENT).appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_TEXT,"text"],[Rt.Msg.HTML_EMAIL,"email"],[Rt.Msg.HTML_NUMBER,"number"],[Rt.Msg.HTML_PASSWORD,"password"],[Rt.Msg.HTML_CHECKBOX,"checkbox"],[Rt.Msg.HTML_RADIOBUTTON,"radiobutton"],[Rt.Msg.HTML_BUTTON,"button"],[Rt.Msg.HTML_COLOUR,"colour"],[Rt.Msg.HTML_DATE,"date"],[Rt.Msg.HTML_LOCALTIME,"local time"],[Rt.Msg.HTML_FILE,"file"],[Rt.Msg.HTML_HIDDEN,"hidden"],[Rt.Msg.HTML_IMAGE,"image"],[Rt.Msg.HTML_MONTH,"month"],[Rt.Msg.HTML_RANGE,"range"],[Rt.Msg.HTML_RESET,"reset"],[Rt.Msg.HTML_SEARCH,"search"],[Rt.Msg.HTML_SUBMIT,"submit"],[Rt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Rt.Msg.HTML_TIME,"time"],[Rt.Msg.HTML_URL,"url"],[Rt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Rt.Msg.HTML_NAME).appendField(new Rt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Rt.Msg.HTML_VALUE).appendField(new Rt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s={init:function(){this.setColour(ws),this.appendDummyInput().appendField(Rt.Msg.HTML_TEXT).appendField(new Rt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},to=160,eo={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Rt.FieldTable(""),"TEXT")}},io={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT")}},no={init:function(){this.setColour(to),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},so={init:function(){this.setColour(to),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},oo={init:function(){this.setColour(to),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Rt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},po={init:function(){this.setColour(to),this.appendValueInput("VALUE").appendField(Rt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},uo={init:function(){this.setColour(to),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Rt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+l()+"("+t+", "+e+", "+i+")"},Rt.isNumber(n)&&Rt.isNumber(s)&&Rt.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const zu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var p=s+" and "+o;else if("OR"==i)p=s+" or "+o;else if("NOR"==i)p="not("+s+"^"+o+")";else p=s+"^"+o;return[p,n]},Zu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},$u=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ta=function(t,e){return["None",e.ORDER_ATOMIC]},ea=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ia=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},na=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sa=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},oa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},pa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ua=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},aa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},la=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},_a=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ra=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Ta=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},ha=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ma=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ca=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Oa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ra=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ma=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ea=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ca=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Aa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ga=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Sa=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Da=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Na=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},fa=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),Rt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],p=0;p\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},al=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ll=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},_l=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},rl=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},dl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Il=function(t,e){return'"},Tl=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},hl=function(){return this.getFieldValue("TEXT")+"\n"},ml=function(t){return t.getFieldValue("TEXT")+"\n"},cl=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ol=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Rl=function(){return""},Ml=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},El=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+p.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+p.join("\n")},Al.scrubNakedValue=function(t){return t+"\n"},Al.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Al.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Al.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=Rt.utils.string.wrap(o,Al.COMMENT_WRAP-3),n+=Al.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const gl=100,Sl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_SERVO).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Dl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["1","1"],["2","2"]]),"op"),this.setOutput(!0)}},Nl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"1"],[Rt.Msg.MIXLY_ESP32_OFF,"0"],[Rt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},fl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Ll={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Fl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},vl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETONOFF)}},Pl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_GETONOFF)}},Vl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETBRIGHT)}},yl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Yl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},bl={init:function(){this.setColour(gl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_NOTONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},kl={init:function(){this.setColour(gl),this.appendValueInput("TICKS").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Rt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Rt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},xl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Xl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_RESET)}},Gl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},Hl={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Ul={init:function(){this.setColour(gl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Bl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Wl={init:function(){this.setColour(gl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MIXGO_MUSIC_PLAY_TONE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAYSHOW)}},Kl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_RGB_PIN_COUNT)}},Ql={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},jl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},ql={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},Jl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},zl={init:function(){this.setColour(gl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},Zl=vl,$l=Pl,t_=Vl,e_="#2FAD7A",i_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},n_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},s_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},o_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},p_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_MESSAGE0})}},u_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_RUN_MESSAGE0})}},a_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_MESSAGE0,args0:[{check:String,type:"input_value",name:"notification"}]})}},l_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_MESSAGE0,args0:[{check:Number,type:"input_value",name:"timer_num"}]})}},__={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_MESSAGE0,args0:[{check:String,type:"input_value",name:"attribute_name"},{type:"input_value",name:"attribute_value"}]})}},r_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_EMAIL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_EMAIL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_EMAIL_MESSAGE0,args0:[{check:String,type:"input_value",name:"TargetEmail"},{check:String,type:"input_value",name:"subject"},{check:String,type:"input_value",name:"body"}]})}},d_={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_MESSAGE0})}},I_={init:function(){this.jsonInit({message0:Rt.Msg.MPYTHON_BLYNKTIMER_MESSAGE0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,args0:[{check:Number,type:"input_value",name:"Num"},{options:[[Rt.Msg.MIXLY_PYTHON_PERIODIC,"False"],[Rt.Msg.MIXLY_PYTHON_ONE_SHOT,"True"]],type:"field_dropdown",name:"Timer_mode"},{check:Number,type:"input_value",name:"period"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},T_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_MESSAGE0,args0:[{type:"input_value",name:"sensor_data"},{check:Number,type:"input_value",name:"virtual_pin"}]})}},h_={init:function(){this.jsonInit({inputsInline:!0,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_DATA_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_DATA_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"},{type:"input_value",name:"virtual_pin_val"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},m_={init:function(){this.jsonInit({nextStatement:null,previousStatement:null,colour:e_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SETUP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SETUP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SETUP_MESSAGE0,args0:[{type:"input_dummy"},{check:String,type:"input_value",name:"server"},{check:Number,type:"input_value",name:"port"},{check:String,type:"input_value",name:"auth"}]})}},c_=120;({init:function(){this.setColour(c_),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT).appendField(new Rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}}).OPERATORS=[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];({init:function(){this.setColour(c_);var t=new Rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}}).OPERATORS=[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const O_=180,R_={colourOptions:["#f00","#000"],columns:2},M_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:Rt.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Clear_display)}},E_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_POINT),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_BRIGHTNESS)}},C_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BRIGHTNESS).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("STAT").setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_DISPLAY_SETPIXEL)}},A_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},g_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DELAY),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},S_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_MONITOR_SHOW_STATIC),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SHOW_STATIC)}},D_={init:function(){this.setColour(O_),this.appendValueInput("PIN",String).setCheck("esp32_image").appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP)}},N_={init:function(){this.jsonInit({colour:O_,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:Rt.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}]})}},f_={init:function(){this.jsonInit({colour:O_,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:Rt.Msg.MIXLY_MICROBIT_Animate_images,args0:[{check:"List",type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+Rt.Msg.MIXLY_MICROBIT_Animate_images1)}},L_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:Rt.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},F_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[Rt.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(Rt.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=Rt.Msg.MIXLY_MICROBIT_monitor;return{on:Rt.Msg.MIXLY_MICROBIT_Turn_on_display,off:Rt.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},v_={init:function(){this.jsonInit({colour:O_,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:Rt.Msg.MIXLY_MICROBIT_Turn_off_display})}},P_={init:function(){this.jsonInit({colour:O_,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:Rt.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Display_is_on1)}},V_={init:function(){this.jsonInit({colour:O_,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}],output:["esp32_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:Rt.Msg.MIXLY_MICROBIT_Built_in_image1,message0:Rt.Msg.MIXLY_MICROBIT_Built_in_image})}},y_={init:function(){this.jsonInit({colour:O_,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{colour:"#000000",type:"field_colour",name:"05"},{colour:"#000000",type:"field_colour",name:"06"},{colour:"#000000",type:"field_colour",name:"07"},{colour:"#000000",type:"field_colour",name:"08"},{colour:"#000000",type:"field_colour",name:"09"},{colour:"#000000",type:"field_colour",name:"0a"},{colour:"#000000",type:"field_colour",name:"0b"},{colour:"#000000",type:"field_colour",name:"0c"},{colour:"#000000",type:"field_colour",name:"0d"},{colour:"#000000",type:"field_colour",name:"0e"},{colour:"#000000",type:"field_colour",name:"0f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{colour:"#000000",type:"field_colour",name:"15"},{colour:"#000000",type:"field_colour",name:"16"},{colour:"#000000",type:"field_colour",name:"17"},{colour:"#000000",type:"field_colour",name:"18"},{colour:"#000000",type:"field_colour",name:"19"},{colour:"#000000",type:"field_colour",name:"1a"},{colour:"#000000",type:"field_colour",name:"1b"},{colour:"#000000",type:"field_colour",name:"1c"},{colour:"#000000",type:"field_colour",name:"1d"},{colour:"#000000",type:"field_colour",name:"1e"},{colour:"#000000",type:"field_colour",name:"1f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{colour:"#000000",type:"field_colour",name:"25"},{colour:"#000000",type:"field_colour",name:"26"},{colour:"#000000",type:"field_colour",name:"27"},{colour:"#000000",type:"field_colour",name:"28"},{colour:"#000000",type:"field_colour",name:"29"},{colour:"#000000",type:"field_colour",name:"2a"},{colour:"#000000",type:"field_colour",name:"2b"},{colour:"#000000",type:"field_colour",name:"2c"},{colour:"#000000",type:"field_colour",name:"2d"},{colour:"#000000",type:"field_colour",name:"2e"},{colour:"#000000",type:"field_colour",name:"2f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{colour:"#000000",type:"field_colour",name:"35"},{colour:"#000000",type:"field_colour",name:"36"},{colour:"#000000",type:"field_colour",name:"37"},{colour:"#000000",type:"field_colour",name:"38"},{colour:"#000000",type:"field_colour",name:"39"},{colour:"#000000",type:"field_colour",name:"3a"},{colour:"#000000",type:"field_colour",name:"3b"},{colour:"#000000",type:"field_colour",name:"3c"},{colour:"#000000",type:"field_colour",name:"3d"},{colour:"#000000",type:"field_colour",name:"3e"},{colour:"#000000",type:"field_colour",name:"3f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"},{colour:"#000000",type:"field_colour",name:"45"},{colour:"#000000",type:"field_colour",name:"46"},{colour:"#000000",type:"field_colour",name:"47"},{colour:"#000000",type:"field_colour",name:"48"},{colour:"#000000",type:"field_colour",name:"49"},{colour:"#000000",type:"field_colour",name:"4a"},{colour:"#000000",type:"field_colour",name:"4b"},{colour:"#000000",type:"field_colour",name:"4c"},{colour:"#000000",type:"field_colour",name:"4d"},{colour:"#000000",type:"field_colour",name:"4e"},{colour:"#000000",type:"field_colour",name:"4f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"50"},{colour:"#000000",type:"field_colour",name:"51"},{colour:"#000000",type:"field_colour",name:"52"},{colour:"#000000",type:"field_colour",name:"53"},{colour:"#000000",type:"field_colour",name:"54"},{colour:"#000000",type:"field_colour",name:"55"},{colour:"#000000",type:"field_colour",name:"56"},{colour:"#000000",type:"field_colour",name:"57"},{colour:"#000000",type:"field_colour",name:"58"},{colour:"#000000",type:"field_colour",name:"59"},{colour:"#000000",type:"field_colour",name:"5a"},{colour:"#000000",type:"field_colour",name:"5b"},{colour:"#000000",type:"field_colour",name:"5c"},{colour:"#000000",type:"field_colour",name:"5d"},{colour:"#000000",type:"field_colour",name:"5e"},{colour:"#000000",type:"field_colour",name:"5f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"60"},{colour:"#000000",type:"field_colour",name:"61"},{colour:"#000000",type:"field_colour",name:"62"},{colour:"#000000",type:"field_colour",name:"63"},{colour:"#000000",type:"field_colour",name:"64"},{colour:"#000000",type:"field_colour",name:"65"},{colour:"#000000",type:"field_colour",name:"66"},{colour:"#000000",type:"field_colour",name:"67"},{colour:"#000000",type:"field_colour",name:"68"},{colour:"#000000",type:"field_colour",name:"69"},{colour:"#000000",type:"field_colour",name:"6a"},{colour:"#000000",type:"field_colour",name:"6b"},{colour:"#000000",type:"field_colour",name:"6c"},{colour:"#000000",type:"field_colour",name:"6d"},{colour:"#000000",type:"field_colour",name:"6e"},{colour:"#000000",type:"field_colour",name:"6f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"70"},{colour:"#000000",type:"field_colour",name:"71"},{colour:"#000000",type:"field_colour",name:"72"},{colour:"#000000",type:"field_colour",name:"73"},{colour:"#000000",type:"field_colour",name:"74"},{colour:"#000000",type:"field_colour",name:"75"},{colour:"#000000",type:"field_colour",name:"76"},{colour:"#000000",type:"field_colour",name:"77"},{colour:"#000000",type:"field_colour",name:"78"},{colour:"#000000",type:"field_colour",name:"79"},{colour:"#000000",type:"field_colour",name:"7a"},{colour:"#000000",type:"field_colour",name:"7b"},{colour:"#000000",type:"field_colour",name:"7c"},{colour:"#000000",type:"field_colour",name:"7d"},{colour:"#000000",type:"field_colour",name:"7e"},{colour:"#000000",type:"field_colour",name:"7f"}],output:"esp32_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:Rt.Msg.MIXLY_ESP32_Create_image}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)}},Y_={init:function(){var t=[[Rt.Msg.MIXLY_UP,"up"],[Rt.Msg.MIXLY_DOWN,"down"],[Rt.Msg.MIXLY_LEFT,"left"],[Rt.Msg.MIXLY_RIGHT,"right"]];this.setColour(O_),this.setOutput(!0),this.setInputsInline(!0),this.appendValueInput("img").appendField(Rt.Msg.DISPLAY_IMAGE_LET).setCheck(["esp32_image","List",String]),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:Rt.Msg.MIXLY_UP,down:Rt.Msg.MIXLY_DOWN,left:Rt.Msg.MIXLY_LEFT,right:Rt.Msg.MIXLY_RIGHT}[t]+s}))}},b_={init:function(){var t=[[Rt.Msg.MICROBIT_DISPLAY_UNION,"+"],[Rt.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(O_),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(Rt.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":Rt.Msg.MIXLY_MICROBIT_image_add,"-":Rt.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},k_={init:function(){this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING,"scroll"]]),"MODE"),this.jsonInit({colour:O_,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:Rt.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},x_={init:function(){this.setColour(O_),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},X_={init:function(){this.setColour(O_),this.appendValueInput("device").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_SETUP).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SETUP+Rt.Msg.MIXLY_DF_LCD+Rt.Msg.MIXLY_LCD_ADDRESS)}},G_={init:function(){this.setColour(O_),this.appendValueInput("row",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},H_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"on()"],[Rt.Msg.MIXLY_OFF,"off()"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(off)"],[Rt.Msg.MIXLY_LCD_BACKLIGHT,"backlight(on)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_DF_LCD+{"on()":Rt.Msg.MIXLY_ON,"off()":Rt.Msg.MIXLY_OFF,"clear()":Rt.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":Rt.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},U_={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendValueInput("row").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO+"OLED").setCheck(Number),this.appendValueInput("column").appendField("X").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip()}},w_={init:function(){this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendValueInput("Text_line1","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.OLEDDISPLAY+Rt.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(O_),this.setTooltip(Rt.Msg.MIXLY_DF_LCD+Rt.Msg.OLEDDISPLAY+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING)}},B_={init:function(){var t=[[Rt.Msg.MIXLY_HEIGHT,"height"],[Rt.Msg.MIXLY_WIDTH,"width"]];this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE+{height:Rt.Msg.MIXLY_HEIGHT,width:Rt.Msg.MIXLY_WIDTH}[t]}))}},W_={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RECT).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_RECT,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"width"},{check:Number,type:"input_value",name:"height"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_OLED_RECT)}},K_={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_DISPLAY_RLINE,"hline"],[Rt.Msg.MIXLY_DISPLAY_VLINE,"vline"]]),"direction"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"length"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE)}},Q_={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE_ARBITRARILY,args0:[{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE_ARBIT)}},j_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS)}},q_={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE),this.setInputsInline(!0),this.setOutput(!0,"esp32_image"),this.setTooltip(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE_TOOLTIP)}},J_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS)}},z_={init:function(){this.setColour(O_),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE)}},Z_={init:function(){this.setColour(O_),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").appendField(Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS).appendField(new Rt.FieldColour("#f00",null,R_),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},$_={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},tr={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},er={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_DELAY)}},ir={init:function(){this.setColour(O_),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SCROLL_IMAGE_OR_STRING_DELAY)}},nr={init:function(){this.setColour(O_),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"ON"],[Rt.Msg.MIXLY_ESP32_OFF,"OFF"]]),"ONOFF"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},sr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:Rt.Msg.MIXLY_LCD_STAT_CLEAR,1:Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return Rt.Msg.MIXLY_DF_LCD+i[e]}))}},or={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["TM1650","TM1650"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{TM1650:"TM1650"}[e]}))}},pr={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"_on"],[Rt.Msg.MIXLY_OFF,"_off"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"_clear"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_power)}},ur={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("VALUE").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_NUMBER),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ar={init:function(){this.setColour(O_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("NO").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER1),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER2+Rt.Msg.MIXLY_4DIGITDISPLAY_DOT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_showDot)}},lr={init:function(){this.setColour(O_),this.setOutput(!0,"Tuple"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISPLAY_ANIMATE).appendField(new Rt.FieldDropdown([["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]]),"ANIMATION")}},_r={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_CIRCLE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"r"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)}},rr={init:function(){var t=[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]];this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE).appendField(new Rt.FieldDropdown(t),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_triangle,args0:[{check:Number,type:"input_value",name:"x0"},{check:Number,type:"input_value",name:"y0"},{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE)}},dr={init:function(){this.setColour("#555555"),this.appendDummyInput("").appendField(Rt.Msg.MIXGO_ONBOARDDISPLAY_HELP),this.setInputsInline(!0),this.setTooltip("")}},Ir={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.OLED_BITMAP),this.appendValueInput("START_X",Number).appendField(Rt.Msg.OLED_START_X).setCheck(Number),this.appendValueInput("START_Y",Number).appendField(Rt.Msg.OLED_START_Y).setCheck(Number),this.appendValueInput("bitmap_name",String).appendField(Rt.Msg.OLED_BITMAP_NAME),this.appendValueInput("WIDTH",Number).appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("HEIGHT",Number).appendField(Rt.Msg.MIXLY_HEIGHT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_SHOW_BMP_TOOLTIP)}},Tr={init:function(){this.setColour(O_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED),this.appendDummyInput("").appendField(Rt.Msg.OLED_DRAWPIXEL),this.appendValueInput("POS_X").appendField(Rt.Msg.OLED_POSX),this.appendValueInput("POS_Y").appendField(Rt.Msg.OLED_POSY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_DRAW_PIXE_TOOLTIP)}},hr={init:function(){this.setColour(O_),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["32x12 Matrix","32x12 Matrix"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},cr={init:function(){this.setColour(O_),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Or="#526FC3",Rr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_CONNECT_WIFI),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},Mr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},Er={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Cr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Ar={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},gr={init:function(){this.setColour(Or),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Sr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Dr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Nr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},fr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_WIFI_USERNAME).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_IOT_PASSWORD).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_PROJECT).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Rt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Fr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_SUBSCRIBE+Rt.Msg.MIXLY_MICROBIT_MSG).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Rt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},vr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Yr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},br={init:function(){this.setColour(Or),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},kr={init:function(){this.setColour(Or),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},xr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Xr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Rt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Gr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+Rt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hr={init:function(){this.setColour(Or),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ur={init:function(){this.VISITOR_ID=Mt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Or),this.appendDummyInput("").appendField(new Rt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},wr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Br={init:function(){this.setColour(Or),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Rt.Msg.MIXLY_REQUESTS_GET).appendField(Rt.Msg.MIXLY_GET_CURRENT_TIME).appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Rt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Rt.Msg.MQTT_Topic).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qr={init:function(){this.setColour(Or),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},jr=Rr,qr=Mr,Jr=Er,zr=Cr,Zr=gr;Rt.Msg.PS2_TRIANGLE,Rt.Msg.PS2_CIRCLE,Rt.Msg.PS2_CROSS,Rt.Msg.PS2_SQUARE,Rt.Msg.PS2_L1,Rt.Msg.PS2_L2,Rt.Msg.PS2_R1,Rt.Msg.PS2_R2,Rt.Msg.PS2_UP,Rt.Msg.PS2_RIGHT,Rt.Msg.PS2_DOWN,Rt.Msg.PS2_LEFT,Rt.Msg.PS2_SELECT,Rt.Msg.PS2_START;const $r=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC);return"music.pitch("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+")\n"},td=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC),n=e.valueToCode(this,"time",e.ORDER_ATOMIC);return"music.pitch_time("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+", "+n+")\n"},ed=function(t,e){return e.definitions_.import_music="import music","music.stop("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")\n"},id=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"BPM",e.ORDER_ASSIGNMENT);return"music.set_tempo("+e.valueToCode(this,"TICKS",e.ORDER_ASSIGNMENT)+", "+i+")\n"},nd=function(t,e){e.definitions_.import_music="import music";return["music.get_tempo()",e.ORDER_ATOMIC]},sd=function(t,e){return e.definitions_.import_music="import music","music.pitch("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+")\n"},od=function(t,e){return e.definitions_.import_music="import music","music.pitch_time("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"time",e.ORDER_ATOMIC)+")\n"},pd=function(t,e){e.definitions_.import_music="import music";return"music.stop()\n"},ud=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+")\n"},ad=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},ld=function(t,e){return e.definitions_.import_music="import music",e.definitions_.import_matrix="import matrix","music.play_show("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},_d=function(t,e){return e.definitions_.import_music="import music","music.reset()\n"},rd=function(t,e){return e.definitions_.import_servo="import servo",e.definitions_.import_machine="import machine","servo.servo_write_angle("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DEGREE",e.ORDER_ATOMIC)+")\n"},dd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Id=function(t,e){return[this.getFieldValue("flag"),e.ORDER_ATOMIC]},Td=function(t,e){e.definitions_.import_mixgo="import mixgo";var i=e.valueToCode(this,"bright",e.ORDER_ATOMIC);return"mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setonoff("+i+")\n"},hd=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").getonoff()",e.ORDER_ATOMIC]},md=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},cd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setonoff("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},Od=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".getonoff()",e.ORDER_ATOMIC]},Rd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},Md=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=e.valueToCode(this,"LEDCOUNT",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",i+" = neopixel.NeoPixel(machine.Pin("+n+"), "+s+", timing = True)\n"},Ed=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".write()\n"},Cd=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},Ad=function(t,e){e.definitions_.import_mixgo="import mixgo";return"mixgo.rgb.write()\n"},gd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},Sd=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb.fill(("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+"))\n"},Dd=cd,Nd=Od,fd=Rd,Ld=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC);e.functions_["terminal_widget_vpin_"+i]=`\nALLOWED_COMMANDS_LIST = ['ls', 'lsusb', 'ip a', 'ip abc']\n\n@blynk.handle_event('write V${i}')\ndef write_handler(pin, _values):\n header = ''\n result = ''\n delimiter = '{}\\n'.format('=' * 30)\n if _values and _values[0] in ALLOWED_COMMANDS_LIST:\n cmd_params = _values[0].split(' ')\n try:\n result = subprocess.check_output(cmd_params).decode('utf-8')\n header = '[output]\\n'\n except subprocess.CalledProcessError as exe_err:\n header = '[error]\\n'\n result = 'Return Code: {}\\n'.format(exe_err.returncode)\n except Exception as g_err:\n print("Command caused '{}'".format(g_err))\n elif _values and _values[0] == 'help':\n header = '[help -> allowed commands]\\n'\n result = '{}\\n'.format('\\n'.join(ALLOWED_COMMANDS_LIST))\n\n # communicate with terminal if help or some allowed command\n if result:\n output = '{}{}{}{}'.format(header, delimiter, result, delimiter)\n print(output)\n blynk.virtual_write(pin, output)\n blynk.virtual_write(pin, '\\n')\n`;return""},Fd=function(t,e){return"blynk.virtual_sync("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+")\n"},vd=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_disconnected="@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n"+i,""},Pd=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_connected="@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n"+i,""},Vd=function(){return"blynk_timer.run()\n"},yd=function(){return"blynk.run()\n"},Yd=function(t,e){return"blynk.notify("+e.valueToCode(this,"notification",e.ORDER_ATOMIC)+")\n"},bd=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";var i=e.valueToCode(this,"timer_num",e.ORDER_ATOMIC);return`blynk_timer.stop('${i}_blynk_timer${i}')\n`},kd=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";return["blynk_timer.get_timers()",e.ORDER_ATOMIC]},xd=function(t,e){e.definitions_.import_blynktimer="import blynktimer";var i=e.valueToCode(this,"Num",e.ORDER_ATOMIC),n=e.valueToCode(this,"period",e.ORDER_ATOMIC),s=this.getFieldValue("Timer_mode"),o=e.statementToCode(this,"DO");return o=e.addLoopTrap(o,this.id)||e.PASS,e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)",e.definitions_["blynktimer_event"+i]=`\n@blynk_timer.register(interval=${n}, run_once=${s})\ndef blynk_timer${i}():\n`+o,""},Xd=function(t,e){var i=e.valueToCode(this,"sensor_data",e.ORDER_ATOMIC);return"blynk.virtual_write("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+", "+i+")\n"},Gd=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC),n=e.statementToCode(this,"DO");return n=e.addLoopTrap(n,this.id)||e.PASS,e.definitions_["blynk_VIRTUAL_WRITE_"+i]="@blynk.handle_event('write V"+i+"')\ndef write_virtual_pin_handler(pin, _value):\n for i in range(0, len(_value)):\n try: _value[i] = eval(_value[i])\n except: pass\n if len(_value) == 1: _value = _value[0]\n"+n,""},Hd=function(t,e){var i=e.valueToCode(this,"body",e.ORDER_ATOMIC),n=e.valueToCode(this,"subject",e.ORDER_ATOMIC);return`blynk.email(${e.valueToCode(this,"TargetEmail",e.ORDER_ATOMIC)}, ${n}, ${i})\n`},Ud=function(t,e){var i=e.valueToCode(this,"attribute_value",e.ORDER_ATOMIC);return`blynk.set_property(pin, ${e.valueToCode(this,"attribute_name",e.ORDER_ATOMIC)}, ${i})\n`},wd=function(t,e){e.definitions_.import_BlynkLib="import blynklib";var i=e.valueToCode(this,"server",e.ORDER_ATOMIC),n=e.valueToCode(this,"auth",e.ORDER_ATOMIC),s=e.valueToCode(this,"port",e.ORDER_ATOMIC);return e.definitions_.mpython_blynk_setup="blynk = blynklib.Blynk("+n+", server="+i+", port="+s+")",e.definitions_.blynk_on_connected="\n@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n",e.definitions_.blynk_on_disconnected="\n@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n",""};const Bd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Wd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Kd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.showstatic("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Qd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},jd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},qd=function(t,e){e.definitions_.import_matrix="import matrix";var i={"#000000":"0","#ff0000":"1"};return['matrix.Image("'+i[t.getFieldValue("00")]+i[t.getFieldValue("01")]+i[t.getFieldValue("02")]+i[t.getFieldValue("03")]+i[t.getFieldValue("04")]+i[t.getFieldValue("05")]+i[t.getFieldValue("06")]+i[t.getFieldValue("07")]+i[t.getFieldValue("08")]+i[t.getFieldValue("09")]+i[t.getFieldValue("0a")]+i[t.getFieldValue("0b")]+i[t.getFieldValue("0c")]+i[t.getFieldValue("0d")]+i[t.getFieldValue("0e")]+i[t.getFieldValue("0f")]+":"+i[t.getFieldValue("10")]+i[t.getFieldValue("11")]+i[t.getFieldValue("12")]+i[t.getFieldValue("13")]+i[t.getFieldValue("14")]+i[t.getFieldValue("15")]+i[t.getFieldValue("16")]+i[t.getFieldValue("17")]+i[t.getFieldValue("18")]+i[t.getFieldValue("19")]+i[t.getFieldValue("1a")]+i[t.getFieldValue("1b")]+i[t.getFieldValue("1c")]+i[t.getFieldValue("1d")]+i[t.getFieldValue("1e")]+i[t.getFieldValue("1f")]+":"+i[t.getFieldValue("20")]+i[t.getFieldValue("21")]+i[t.getFieldValue("22")]+i[t.getFieldValue("23")]+i[t.getFieldValue("24")]+i[t.getFieldValue("25")]+i[t.getFieldValue("26")]+i[t.getFieldValue("27")]+i[t.getFieldValue("28")]+i[t.getFieldValue("29")]+i[t.getFieldValue("2a")]+i[t.getFieldValue("2b")]+i[t.getFieldValue("2c")]+i[t.getFieldValue("2d")]+i[t.getFieldValue("2e")]+i[t.getFieldValue("2f")]+":"+i[t.getFieldValue("30")]+i[t.getFieldValue("31")]+i[t.getFieldValue("32")]+i[t.getFieldValue("33")]+i[t.getFieldValue("34")]+i[t.getFieldValue("35")]+i[t.getFieldValue("36")]+i[t.getFieldValue("37")]+i[t.getFieldValue("38")]+i[t.getFieldValue("39")]+i[t.getFieldValue("3a")]+i[t.getFieldValue("3b")]+i[t.getFieldValue("3c")]+i[t.getFieldValue("3d")]+i[t.getFieldValue("3e")]+i[t.getFieldValue("3f")]+":"+i[t.getFieldValue("40")]+i[t.getFieldValue("41")]+i[t.getFieldValue("42")]+i[t.getFieldValue("43")]+i[t.getFieldValue("44")]+i[t.getFieldValue("45")]+i[t.getFieldValue("46")]+i[t.getFieldValue("47")]+i[t.getFieldValue("48")]+i[t.getFieldValue("49")]+i[t.getFieldValue("4a")]+i[t.getFieldValue("4b")]+i[t.getFieldValue("4c")]+i[t.getFieldValue("4d")]+i[t.getFieldValue("4e")]+i[t.getFieldValue("4f")]+":"+i[t.getFieldValue("50")]+i[t.getFieldValue("51")]+i[t.getFieldValue("52")]+i[t.getFieldValue("53")]+i[t.getFieldValue("54")]+i[t.getFieldValue("55")]+i[t.getFieldValue("56")]+i[t.getFieldValue("57")]+i[t.getFieldValue("58")]+i[t.getFieldValue("59")]+i[t.getFieldValue("5a")]+i[t.getFieldValue("5b")]+i[t.getFieldValue("5c")]+i[t.getFieldValue("5d")]+i[t.getFieldValue("5e")]+i[t.getFieldValue("5f")]+":"+i[t.getFieldValue("60")]+i[t.getFieldValue("61")]+i[t.getFieldValue("62")]+i[t.getFieldValue("63")]+i[t.getFieldValue("64")]+i[t.getFieldValue("65")]+i[t.getFieldValue("66")]+i[t.getFieldValue("67")]+i[t.getFieldValue("68")]+i[t.getFieldValue("69")]+i[t.getFieldValue("6a")]+i[t.getFieldValue("6b")]+i[t.getFieldValue("6c")]+i[t.getFieldValue("6d")]+i[t.getFieldValue("6e")]+i[t.getFieldValue("6f")]+":"+i[t.getFieldValue("70")]+i[t.getFieldValue("71")]+i[t.getFieldValue("72")]+i[t.getFieldValue("73")]+i[t.getFieldValue("74")]+i[t.getFieldValue("75")]+i[t.getFieldValue("76")]+i[t.getFieldValue("77")]+i[t.getFieldValue("78")]+i[t.getFieldValue("79")]+i[t.getFieldValue("7a")]+i[t.getFieldValue("7b")]+i[t.getFieldValue("7c")]+i[t.getFieldValue("7d")]+i[t.getFieldValue("7e")]+i[t.getFieldValue("7f")]+'")',e.ORDER_ATOMIC]},Jd=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.Image."+t.getFieldValue("image"),e.ORDER_ATOMIC]},zd=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.get_pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},Zd=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},$d=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_brightness()",e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_screenimage()",e.ORDER_ATOMIC]},eI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},iI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.blink_rate("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},nI=function(t,e){e.definitions_.import_matrix="import matrix";return"matrix.clear()\n"},sI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},oI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},pI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},uI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),p=e.valueToCode(this,"height",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP"),l="";switch(u){case"True":l=i+".show_fill_rect("+n+", "+s+", "+o+", "+p+","+a+")\n";break;case"False":l=i+".show_rect("+n+", "+s+", "+o+", "+p+","+a+")\n"}return l},aI=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP"),n=e.valueToCode(t,"A",e.ORDER_ATOMIC),s=e.valueToCode(t,"B",e.ORDER_ATOMIC);return["INTERSECTION"==i?n+"-("+n+"-"+s+")":n+i+s,e.ORDER_ATOMIC]},lI=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},_I=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},rI=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dI=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},II=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},TI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+this.getFieldValue("STAT")+"()\n"},hI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_num("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},mI=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_dot("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},cI=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},OI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",u=this.getFieldValue("OP"),a="";switch(p){case"True":a=i+".show_fill_circle("+n+", "+s+", "+o+", "+u+")\n";break;case"False":a=i+".show_circle("+n+", "+s+", "+o+", "+u+")\n"}return a},RI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),p=e.valueToCode(this,"y1",e.ORDER_ATOMIC),u=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),l="TRUE"==this.getFieldValue("fill")?"True":"False",_=this.getFieldValue("OP"),r="";switch(l){case"True":r=i+".show_fill_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n";break;case"False":r=i+".show_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n"}return r},MI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},EI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},CI=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=n+" = matrix32x12.Matrix("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},AI=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_matrix32x12="import matrix32x12",i+".set_buffer("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},gI=function(t,e){return e.definitions_.import_matrix32x12="import matrix32x12",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},SI=function(t,e){return e.definitions_.import_mixiot="import mixiot","mixiot.wlan_connect("+e.valueToCode(this,"WIFINAME",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+")\n"},DI=function(t,e){return e.definitions_.import_onenet="import onenet",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+" = onenet.init_MQTT_client("+e.valueToCode(this,"CLIENT",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SERVER",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC)+", "+(e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)||"None")+")\n"},NI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".do_disconnect()\n"},fI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"DICT",e.ORDER_ATOMIC),s="TRUE"==this.getFieldValue("is_print")?"True":"False";return e.definitions_.import_onenet="import onenet",i+".publish("+n+", is_print = "+s+")\n"},LI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".check_msg()\n"},FI=function(t,e){e.definitions_.import_onenet="import onenet";var i=new Array(this.itemCount_),n=new Array(this.itemCount_),s=new Array(this.itemCount_),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);for(let t=0;te?t[e]:"ni-hao"),"KEY"+e).appendField("”:")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mm={init:function(){this.setColour(cm),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("启动识别 返回结果"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("语音识别,获取识别结果")}},Em={init:function(){this.setColour(cm),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("注销识别 内存释放"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("语音识别,注销语音识别,释放内存")}},Cm="#90A244",Am={init:function(){this.setColour(Cm),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["否","0"],["是","1"]]),"flag"),this.setOutput(!0),this.setTooltip()}},gm={init:function(){this.setColour(Cm),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("path").appendField("打开路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("打开一个新的图像对象")}},Sm={init:function(){this.setColour(Cm),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField("打开空图"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开一个空的图像对象")}},Dm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像信息"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["宽度","width"],["高度","height"],["格式","format"],["大小","size"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取图像的宽度、高度、格式、大小")}},Nm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像保存"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("图像的副本保存到文件系统")}},fm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像截取"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("复制一个图像图像的副本")}},Lm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB"),this.appendDummyInput().appendField("["),this.appendValueInput("R").setCheck(Number),this.appendValueInput("G").appendField(",").setCheck(Number),this.appendValueInput("B").appendField(",").setCheck(Number),this.appendDummyInput().appendField("]"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("对图像进行适当压缩")}},Fm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像压缩"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("quality").setAlign(Rt.inputs.Align.RIGHT).appendField("压缩率").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("对图像进行适当压缩")}},vm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像清除"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("将图像中的所有像素设置为零")}},Pm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像转换"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("转换为").appendField(new Rt.FieldDropdown([["灰度图","to_grayscale"],["彩色图","to_rgb565"],["彩虹图","to_rainbow"],["AI格式","pix_to_ai"],["字节块","to_bytes"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("将图像转换为灰度图、彩色图、彩虹图像")}},Vm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("修改点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("设置图像某点像素值")}},ym={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("获取点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("获取图像某点像素值")}},Ym={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("字库加载"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("从SD中加载需要显示文字的字库")}},bm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("字库释放"),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("释放字库所占的内存")}},km={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本(中)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个文本")}},xm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个中文文本")}},Xm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制文本(英)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个字符文本")}},Gm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制直线"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一条从(x0,y0)到(x1,y1)的线")}},Hm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制箭头"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个箭头")}},Um={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制十字"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("延伸").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个十字")}},wm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制圆形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyr"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个圆形")}},Bm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制矩形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xywh"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个矩形")}},Wm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制特征点"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("对象"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setTooltip("绘制一个特征点对象的各个点")}},Km={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("绘制图像"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("x_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("x缩放").setCheck(Number),this.appendValueInput("y_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("y缩放").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("绘制一个image图像")}},Qm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直线识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("theta_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendValueInput("rho_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并斜率").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别直线,返回image.line对象列表")}},jm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("线段识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("distance").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.appendValueInput("difference").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别线段,返回image.line对象列表")}},qm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("圆形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("r_min").setAlign(Rt.inputs.Align.RIGHT).appendField("最小r").setCheck(Number),this.appendValueInput("r_max").setAlign(Rt.inputs.Align.RIGHT).appendField("最大r").setCheck(Number),this.appendValueInput("r_step").setAlign(Rt.inputs.Align.RIGHT).appendField("步长r").setCheck(Number),this.appendValueInput("x_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并x值").setCheck(Number),this.appendValueInput("y_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并y值").setCheck(Number),this.appendValueInput("r_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并r值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[circle]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别圆形,返回image.cirle对象列表")}},Jm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("矩形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[rect]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用四元检测识别矩形,返回image.rect对象列表")}},zm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("线性回归"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("robust").setAlign(Rt.inputs.Align.RIGHT).appendField("泰尔指数").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("计算线性回归,返回image.line对象列表")}},Zm={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直线解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","line"],["x1分量","x1"],["y1分量","y1"],["x2分量","x2"],["y2分量","y2"],["长度","length"],["角度","theta"],["斜率","rho"],["模","magnitude"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.line列表,获取直线信息")}},$m={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("圆形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xyr","circle"],["x分量","x"],["y分量","y"],["r分量","r"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.circle列表,获取圆形信息")}},tc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("矩形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.rect列表,获取矩形信息")}},ec={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("直方图均衡"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("limit").setAlign(Rt.inputs.Align.RIGHT).appendField("对比度").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单直方图均衡化")}},ic={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("模糊滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("offset").setAlign(Rt.inputs.Align.RIGHT).appendField("补偿").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单模糊滤波")}},nc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("卡通化滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单卡通滤波器")}},sc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像腐蚀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像腐蚀,从分割区域的边缘删除像素(白色目标区域)")}},oc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像膨胀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像膨胀,将像素添加到分割区域的边缘中(白色目标区域)")}},pc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像填充"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("开始坐标"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("反转"),this.appendValueInput("clear").setAlign(Rt.inputs.Align.RIGHT).appendField("清除"),this.setOutput(!0),this.setTooltip("像洪水一样填充图像中低矮凹陷的地方(洪水填充)")}},uc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像投影"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("垂直投影"),this.setOutput(!0),this.setTooltip("图像从笛卡尔坐标到线性极坐标重新投影")}},ac={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像反转"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("翻转图像中的所有像素值")}},lc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("校正缩放"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendValueInput("strength").appendField("校正值").setCheck(Number),this.appendValueInput("zoom").appendField("缩放值").setCheck(Number),this.setOutput(!0),this.setTooltip("翻转图像中的所有像素值")}},_c={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像二值化"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("zero").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值像素为零"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("根据像素是否在阈值列表 thresholds 中的阈值内,将图像中的所有像素设置为黑色或白色。")}},rc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("图像边缘检测"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("kernel").setAlign(Rt.inputs.Align.RIGHT).appendField("内核"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("通过过滤器内核对图像进行卷积。")}},dc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("条形码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[barcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setOutput(!0),this.setTooltip("使用条形码识别,返回image.barcode对象列表")}},Ic={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("二维码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[qrcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用二维码识别,返回image.line对象列表")}},Tc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("AprilTag识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[apriltag]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用image.TAG36H11识别,返回image.apriltag对象列表")}},hc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("二维码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["版本","version"],["掩码","mask"],["类型","data_type"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.qrcode列表,获取二维码信息")}},mc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("条形码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["类型","type"],["角度","rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},cc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("AprilTag解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["号码","id"],["家族","family"],["弧度","rotation"],["x向距离","x_translation"],["y向距离","y_translation"],["z向距离","z_translation"],["x向弧度","x_rotation"],["y向弧度","y_rotation"],["z向弧度","z_rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.apriltag列表,获取Apriltag信息")}},Oc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色块追踪"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值LAB"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("area").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉区域").setCheck(Number),this.appendValueInput("pixel").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉素数").setCheck(Number),this.appendValueInput("margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("重叠"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[blob]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用色块追踪,返回image.blob对象列表")}},Rc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("颜色识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[histogram]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用直方图识别颜色,返回image.histogram对象列表")}},Mc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("追踪解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["像素量","pixels"],["弧度","rotation"],["号码数","code"],["合并量","count"],["面积","area"],["密度比","density"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.blob列表,获取追踪色块信息")}},Ec={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色阈浮点"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图浮点列表","bins"],["LAB的L浮点列表","l_bins"],["LAB的A浮点列表","a_bins"],["LAB的B浮点列表","b_bins"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},Cc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("颜色解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendValueInput("percentile").appendField("CDF").setCheck(Number),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过histogram列表,获取识别颜色信息")}},Ac={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("色阈解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},gc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB888值"),this.appendValueInput("LIST").appendField("由LAB"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("LAB转RGB888")}},Sc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("LAB值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转LAB")}},Dc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("灰度值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转灰度图")}},Nc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("RGB888"),this.appendValueInput("g_value").appendField("由灰度值").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("灰度图转RGB888")}},fc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("定向梯度图"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("线长").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("用HOG(定向梯度直方图)线替换ROI中的像素,仅支持灰度图像")}},Lc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("max_keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("关键点数").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("角点数").setCheck(Number),this.appendValueInput("scale_factor").setAlign(Rt.inputs.Align.RIGHT).appendField("比例因子").setCheck(Number),this.appendValueInput("normalized").setAlign(Rt.inputs.Align.RIGHT).appendField("多比例"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[keypoints]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},Fc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征比较"),this.appendValueInput("VAR1").setAlign(Rt.inputs.Align.RIGHT).appendField("对象1").setCheck("var"),this.appendValueInput("VAR2").setAlign(Rt.inputs.Align.RIGHT).appendField("对象2").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("相似度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[kptmatch]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},vc={init:function(){this.setColour(Cm),this.appendDummyInput().appendField("特征信息"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["匹配量","count"],["弧度","theta"],["匹配点-xy","match"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.kptmatch列表,获取追踪特征信息")}},Pc=20,Vc={init:function(){this.setColour(Pc),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_HIGH,"HIGH"],[Rt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},yc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("初始化 "),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_Digital_PINMODEOUT,"GPIO.OUT"],[Rt.Msg.MIXLY_Digital_PINMODEIN,"GPIO.IN"],[Rt.Msg.MIXLY_PINMODEPULLUP,"GPIO.IN, board.GPIO.PULL_UP"],[Rt.Msg.MIXLY_PINMODEPULLDOWN,"GPIO.IN, board.GPIO.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)}},Yc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},bc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField("值"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},kc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("初始化 PWM输出"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("freq").appendField("频率").setCheck(Number),this.appendValueInput("VAR").appendField("定时器").setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化PWM输出设置,需要调用定时器")}},xc={init:function(){this.setColour(Pc),this.appendValueInput("PIN",Number).appendField("PWM输出").setCheck(Number),this.appendValueInput("pwm").appendField("占空比").setCheck(Number),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("PWM输出,值范围为0-100%,可以为小数")}},Xc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("硬件中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_RISING,"GPIO.IRQ_RISING"],[Rt.Msg.MIXLY_FALLING,"GPIO.IRQ_FALLING"],[Rt.Msg.MIXLY_CHANGE,"GPIO.IRQ_BOTH"]]),"mode"),this.appendValueInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},Gc={init:function(){this.setColour(Pc),this.appendDummyInput().appendField("取消中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("取消中断")}},Hc="#637AAC",Uc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField("OneNET 连接WiFi"),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},wc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},Bc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Wc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Kc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},Qc={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},qc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},zc=Uc,Zc=wc,$c=Bc,tO=Wc,eO=Qc,iO=230;Rt.FieldTextInput.math_number_validator=function(t){return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const nO={init:function(){this.setColour(iO),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},sO={init:function(){this.setColour(iO);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},oO={init:function(){this.setColour(iO),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},pO={init:function(){this.setColour(iO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},uO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},aO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},lO={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(iO),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},_O={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(iO),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},rO={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(iO),this.appendValueInput("LIST").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},dO={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(iO),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},IO={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(iO),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},TO={init:function(){this.setColour(iO),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},hO={init:function(){this.setColour(iO),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},mO={init:function(){this.setColour(iO),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},cO={init:function(){this.setColour(iO),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},OO=hO,RO="#2E9883",MO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("PS2手柄"),this.appendValueInput("miso_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("DAT#").setCheck(Number),this.appendValueInput("mosi_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CMD#").setCheck(Number),this.appendValueInput("cs_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("SEL#").setCheck(Number),this.appendValueInput("clk_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CLK#").setCheck(Number),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用PS2手柄控制")}},EO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("UART键盘"),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用串口键盘控制")}},CO={init:function(){this.setColour(RO),this.appendDummyInput().appendField("NES 运行游戏"),this.appendValueInput("path").appendField("路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("运行NES游戏ROM")}},AO="#5B6DA5",gO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("ESP-AT 初始化"),this.appendValueInput("RX",Number).appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("使用串口连接ESP-AT设备,并初始化配置")}},SO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi扫描"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("扫描附近可用的WiFi信息-返回多信息列表")}},DO={init:function(){this.setColour(AO),this.appendDummyInput("").appendField("WiFi连接"),this.appendValueInput("account").appendField("名称").setCheck(String),this.appendValueInput("password").appendField("密码").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("配置WiFi名称及密码,连接WiFi上网")}},NO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi").appendField(new Rt.FieldDropdown([["连接信息","1"],["连接状态","2"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("查看wifi连接信息或者连接状态")}},fO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("WiFi断开连接"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("断开wifi连接")}},LO={init:function(){this.setColour(AO),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField("打开热点"),this.appendValueInput("account").setAlign(Rt.inputs.Align.RIGHT).appendField("名称").setCheck(String),this.appendValueInput("password").setAlign(Rt.inputs.Align.RIGHT).appendField("密码").setCheck(String),this.appendValueInput("chl").setAlign(Rt.inputs.Align.RIGHT).appendField("通道").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("加密").appendField(new Rt.FieldDropdown([["WPA2_PSK","WPA2_PSK"],["OPEN","OPEN"],["WPA_PSK","WPA_PSK"],["WPA_WPA2_PSK","WPA_WPA2_PSK"]]),"mode"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开WiFi热点并配置")}},FO={init:function(){this.setColour(AO),this.appendDummyInput().appendField("关闭热点"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("关闭热点")}},vO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("套接字 初始化"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("套接字初始化")}},PO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("获取地址"),this.appendValueInput("addr").setAlign(Rt.inputs.Align.RIGHT).appendField("域名").setCheck(String),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接字根据域名解析地址IP信息")}},VO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("创建连接"),this.appendValueInput("address").appendField("地址"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接字创建目标IP地址连接")}},yO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("超时时间"),this.appendValueInput("time").setAlign(Rt.inputs.Align.RIGHT).appendField("").setCheck(Number),this.appendDummyInput().appendField("s"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("设置阻塞套接字超时时间")}},YO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendValueInput("content").appendField("发送数据"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接发送数据")}},bO={init:function(){this.setColour(AO),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("接收数据"),this.appendValueInput("size").appendField("字节").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接接收数据,返回接收到的数据对象")}},kO={init:function(){this.setColour(AO),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},xO=230,XO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital),"PIN"),this.setOutput(!0)}},GO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},HO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog),"PIN"),this.setOutput(!0)}},UO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},wO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac),"PIN"),this.setOutput(!0)}},BO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},WO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},KO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},QO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},jO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},qO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch),"PIN"),this.setOutput(!0)}},JO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},zO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},ZO={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},$O={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},tR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},eR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},iR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},nR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},sR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},oR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},pR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},uR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},aR={init:function(){this.setColour(xO),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},lR=40,_R={init:function(){this.setColour(lR),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["A","17"],["B","16"]]),"KEY"),this.setOutput(!0),this.setTooltip()}},rR={init:function(){this.setColour(lR),this.appendDummyInput().appendField("初始化"),this.appendValueInput("key").appendField("按键"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化按键")}},dR={init:function(){this.setColour(lR),this.appendValueInput("key").appendField("按键"),this.appendDummyInput().appendField("被按下?"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip("获取按键值")}},IR={init:function(){this.setColour(lR),this.appendDummyInput().appendField("DHT11"),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField("获取").appendField(new Rt.FieldDropdown([["温度-℃","0"],["湿度-%","1"],["温湿度","2"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("dht11,获取温湿度")}},TR={init:function(){this.setColour(lR),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CHAOSHENGBO),this.appendValueInput("PIN1",Number).appendField("Trig #").setCheck(Number),this.appendValueInput("PIN2",Number).appendField("Echo #").setCheck(Number),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_CHAOSHENGBO)}},hR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},mR={init:function(){this.setColour(lR),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("MPU9250","key");var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{MPU9250:"MPU9250",SHT20:"SHT20",BMP280:"BMP280",ADXL345:"ADXL345"}[e]}))}},cR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[Rt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},OR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[Rt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},RR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_GET+Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},MR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},ER={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_GETTEMPERATUE)}},CR={init:function(){this.setColour(lR),this.appendValueInput("SUB").appendField("ADXL345").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},AR=65,gR={init:function(){this.setColour(AR),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},SR={init:function(){this.setColour(AR),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_Huanhang_TOOLTIP+Rt.Msg.TEXT_PRINT_TOOLTIP)}},DR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.appendValueInput("CONTENT",Number).appendField(new Rt.FieldDropdown([[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_DEC,"int"],[Rt.Msg.MATH_HEX,"hex"]]),"STAT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setFieldValue("hex","STAT"),this.setTooltip(Rt.Msg.TEXT_PRINT_HEX_TOOLTIP)}},NR={init:function(){this.setColour(AR),this.appendValueInput("char_marker").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_WHEN_CONTAIN_DATA),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO)}},fR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_READSTR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_READ_STR)}},LR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_SERIAL_AVAILABLE1)}},FR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_ESP32_READ_LINE),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_READ_LINE1)}},vR={init:function(){this.setColour(AR),this.appendDummyInput().appendField("Serial "+Rt.Msg.MIXLY_SERIAL_READSTR_UNTIL).appendField(new Rt.FieldDropdown([["new line","serial.delimiters(Delimiters.NewLine)"],[",","serial.delimiters(Delimiters.Comma)"],["$","serial.delimiters(Delimiters.Dollar)"],[":","serial.delimiters(Delimiters.Colon)"],[".","serial.delimiters(Delimiters.Fullstop)"],["#","serial.delimiters(Delimiters.Hash)"]]),"char_marker"),this.setInputsInline(!0),this.setOutput(!0,String)}},PR={init:function(){this.setColour(AR),this.appendValueInput("RX",Number).appendField(Rt.Msg.MIXLY_SETUP).appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SERIAL_BEGIN).appendField(new Rt.FieldDropdown([["115200","115200"],["57600","57600"],["37400","38400"],["31250","31250"],["28800","28800"],["19200","19200"],["14400","14400"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["300","300"]]),"baudrate"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SERIAL_softserial)}},VR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Rt.Msg.INOUT_input_TOOLTIP)}},yR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.BLOCKPY_PRINT_TOOLTIP)}},YR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},bR={init:function(){this.setColour(AR),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Rt.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},kR={init:function(){this.setColour(AR),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["system_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("system_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n {\n"+e.statementToCode(this,"do")+"})\n"},MS=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},ES=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},CS=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},AS=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},gS=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},SS=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},DS=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},NS=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},fS=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},LS=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},FS=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},vS=function(){return"while True:\n pass\n"},PS=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},VS=function(t,e){e.definitions_["import machine"]="import machine";return"machine.reset()\n"},yS=function(t,e){return e.definitions_["import gc"]="import gc",this.getFieldValue("gc")+"\n"},YS=function(t,e){return e.definitions_.import_os="import os","os.uname()"},bS=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},kS=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=i%3,s=parseInt(i/3),o=e.valueToCode(this,"period",e.ORDER_NONE);return"tim"+i+" =Timer(Timer.TIMER"+n+",Timer.CHANNEL"+s+",mode=Timer.MODE_"+this.getFieldValue("mode")+",period = "+o+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},xS=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},XS=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"tim"+i+" = Timer(Timer.TIMER"+i%3+",Timer.CHANNEL"+parseInt(i/3)+", mode=Timer.MODE_PWM)\n"},GS=XS,HS=kS,US=xS,wS=bS;const BS=function(t,e){return["["+this.getFieldValue("TEXT")+"]",e.ORDER_ATOMIC]},WS=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},KS=function(t,e){var i=this.getFieldValue("COLOR");return["("+("0x"+(i=i.substr(1)).substr(0,2))+","+("0x"+i.substr(2,2))+","+("0x"+i.substr(4,2))+")",e.ORDER_ATOMIC]},QS=function(t,e){var i=this.getFieldValue("COLOR");return[i=function(t){var e,i,n;e=(t=t.substr(1)).substr(0,2),i=t.substr(2,2),n=t.substr(4,2);var s=(64512&(t="0x"+(t=e+i+n)))>>10;return((248&t)>>3<<8)+((7&s)<<13)+((16252928&t)>>19<<3)+((56&s)>>3)}(i),e.ORDER_ATOMIC]};Object.assign(Rt.Variables,Ct),Object.assign(Rt.Procedures,es),Rt.Python=Al,Rt.generator=Al,Mt.Profile.default={},Object.assign(Mt.Profile,ZI),Object.assign(Mt.Profile.default,ZI.k210),Object.assign(Rt.Blocks,e,i,n,s,o,p,u,a,l,_,r,d,I,F,L,f,N,Y,b,k,x,X,G,H,U,w,B,W,K,Q,j,q,J,z,Z,$),Object.assign(Rt.Python.forBlock,T,h,m,c,O,R,M,E,C,A,g,S,D,y,V,P,v,tt,et,it,nt,st,ot,pt,ut,at,lt,_t,rt,dt,It,Tt,ht,mt,ct,Ot)})(); \ No newline at end of file diff --git a/boards/default/micropython_nrf51822_microbit/main.bundle.js b/boards/default/micropython_nrf51822_microbit/main.bundle.js index aa4a94e5..f437a6c6 100644 --- a/boards/default/micropython_nrf51822_microbit/main.bundle.js +++ b/boards/default/micropython_nrf51822_microbit/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Q{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(W.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(W.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(W.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(W.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(at),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.PYTHON_RANGE).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ht={init:function(){this.setColour(at),this.appendValueInput("LIST").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(W.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return W.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mt={init:function(){this.setColour(at),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(W.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new W.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(W.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:W.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:W.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},mt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(at);var t=new W.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:W.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:W.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Ot={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new W.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return W.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Et={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new W.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return W.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Mt.OPERATORS=[[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ct.OPERATORS=[[W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Rt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(W.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},gt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Ct={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(W.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},At={init:function(){this.setColour(at),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Lt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},St={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Nt={init:function(){this.jsonInit({message0:W.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:at,tooltip:W.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:W.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Dt={init:function(){this.setColour(at),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_STAT),this.setOutput(!0)}},ft={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Pt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Ft={init:function(){this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT+W.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(W.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new W.FieldDropdown([[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(at),this.setTooltip("do-while loop"),this.setHelpUrl("")}},vt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Vt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},bt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET+W.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_GET_UNIQUE_IDEN)}},Xt={init:function(){this.setColour(at),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(W.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},yt=230;W.FieldTextInput.math_number_validator=function(t){return String(t)},W.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Ut={init:function(){this.setColour(yt),this.appendDummyInput().appendField(new W.FieldTextInput("0",W.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(W.Msg.MATH_NUMBER_TOOLTIP)}},Bt={init:function(){this.setColour(yt);this.appendDummyInput("").appendField(W.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new W.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Gt={init:function(){this.setColour(yt);this.appendDummyInput("").appendField(W.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new W.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},wt={init:function(){this.setColour(yt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:W.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:W.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:W.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:W.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:W.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(yt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:W.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:W.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:W.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:W.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:W.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ht={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new W.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},xt={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new W.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:W.Msg.MATH_TRIG_TOOLTIP_SIN,COS:W.Msg.MATH_TRIG_TOOLTIP_COS,TAN:W.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:W.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:W.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:W.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:W.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Wt={init:function(){var t=[[W.Msg.MATH_BIN,"bin"],[W.Msg.MATH_OCT,"oct"],[W.Msg.MATH_HEX,"hex"]];this.setColour(yt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new W.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:W.Msg.MATH_DEC_TOOLTIP_BIN,oct:W.Msg.MATH_DEC_TOOLTIP_OCT,hex:W.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Kt={init:function(){var t=[[W.Msg.LANG_MATH_TO_ROUND,"round"],[W.Msg.LANG_MATH_TO_CEIL,"ceil"],[W.Msg.LANG_MATH_TO_FLOOR,"floor"],[W.Msg.MATH_ABS,"fabs"],[W.Msg.MATH_SQRT,"sqrt"]];this.setColour(yt),this.appendValueInput("A").setCheck(Number).appendField(new W.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:W.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:W.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:W.Msg.MATH_SINGLE_TOOLTIP_SQ,round:W.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:W.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:W.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Jt={init:function(){var t=[[W.Msg.MIXLY_MAX,"max"],[W.Msg.MIXLY_MIN,"min"]];this.setColour(yt),this.appendValueInput("A").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(new W.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(W.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:W.Msg.MIXLY_TOOLTIP_MATH_MAX,min:W.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},jt={init:function(){var t=[[W.Msg.MATH_TWO,"two"],[W.Msg.MATH_EIGHT,"eight"],[W.Msg.MATH_TEN,"ten"],[W.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(yt),this.appendDummyInput("").appendField(W.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new W.FieldDropdown(t),"OP").appendField(W.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(W.Msg.MATH_ZHW).appendField(new W.FieldDropdown(t),"OP2").appendField(W.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:W.Msg.MATH_Before_two,eight:W.Msg.MATH_Before_eight,ten:W.Msg.MATH_Before_ten,sixteen:W.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:W.Msg.MATH_Behind_two,eight:W.Msg.MATH_Behind_eight,ten:W.Msg.MATH_Behind_ten,sixteen:W.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Qt={init:function(){var t=[[W.Msg.LANG_MATH_INT,"int"],[W.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(yt),this.setOutput(!0,Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_RANDOM).appendField(new W.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:W.Msg.LANG_MATH_INT,float:W.Msg.LANG_MATH_FLOAT_RANDOM};return W.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},qt={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(W.Msg.MATH_CONSTRAIN_TOOLTIP)}},zt={init:function(){this.setColour(yt),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(W.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(W.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(new W.FieldTextInput("0",W.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(W.Msg.MATH_NUMBER_TOOLTIP)}},$t={init:function(){this.setColour(yt),this.appendValueInput("NUM").setCheck(Number).appendField(W.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},te={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(W.Msg.MATH_ROUND).appendField(W.Msg.TEXT_KEEP),this.appendDummyInput().appendField(W.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(W.Msg.MATH_ROUND_NEW_TOOLTIP)}},ee={init:function(){var t=[[W.Msg.MIXLY_TO_INT,"int"],[W.Msg.MIXLY_TO_FLOAT,"float"],[W.Msg.MIXLY_TO_BITES,"b"],[W.Msg.LANG_MATH_BYTE+W.Msg.MIXLY_TO_INT,"bti"]];this.setColour(yt),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:W.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:W.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:W.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ie={init:function(){var t=[[W.Msg.MIXLY_TO_INT,"int"],[W.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(yt),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:W.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:W.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ne=zt,se={init:function(){this.setColour(yt),this.appendValueInput("VAR").appendField(W.Msg.LANG_MATH_BYTE+W.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},oe={init:function(){this.setColour(yt),this.itemCount_=1,this.setMutator(new W.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(W.Msg.MIXLY_PRODUCT+W.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(W.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(W.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const re={init:function(){this.setColour(_e),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new W.FieldTextInput("",W.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(W.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new W.FieldImage(e,7,12,'"')}},pe={init:function(){this.setColour(_e),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(W.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},le={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(Number).appendField(W.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ie={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Te={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},de={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},he={init:function(){this.WHERE_OPTIONS=[[W.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[W.Msg.TEXT_GET_INDEX_RANDOM+1+W.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(W.Msg.LISTS_GET_INDEX_GET,"MODE"),W.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(W.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+W.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",W.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:W.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:W.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:W.Msg.TEXT_GET_INDEX_RANDOM};return W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+W.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==W.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),W.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(W.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new W.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),W.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Me={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(W.Msg.LISTS_GET_INDEX_GET+" "+W.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(W.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.LISTS_GET_INDEX_FROM_START+"n"+W.Msg.TEXT_CHARAT2)}},me={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(W.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(W.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ce={init:function(){this.WHERE_OPTIONS_1=[[W.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[W.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[W.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[W.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(W.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==W.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==W.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),W.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(W.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new W.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Oe={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(W.Msg.LISTS_GET_INDEX_GET+" "+W.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(W.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(W.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(W.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ee={init:function(){var t=[[W.Msg.MIXLY_EQUALS,"==="],[W.Msg.MIXLY_STARTSWITH,"startswith"],[W.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(_e),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new W.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Re={init:function(){this.setColour(_e),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(W.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_COMPARETO_HELP)}},ge={init:function(){var t=[[W.Msg.TEXT_UPPER,"upper"],[W.Msg.TEXT_TITLE,"title"],[W.Msg.TEXT_CAPITALIZE,"capitalize"],[W.Msg.TEXT_SWAPCASE,"swapcase"],[W.Msg.TEXT_LOWER,"lower"]];this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new W.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:W.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:W.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:W.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:W.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:W.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ce={init:function(){var t=[[W.Msg.TEXT_LJUST,"ljust"],[W.Msg.TEXT_CENTER,"center"],[W.Msg.TEXT_RJUST,"rjust"]];this.setColour(_e),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(W.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(W.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ae={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(W.Msg.MIXLY_MID+W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(W.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Le={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Se={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(W.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(W.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ne={init:function(){this.setColour(_e),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(W.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(W.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},De={init:function(){var t=[[W.Msg.TEXT_TRIM_BOTH,"strip"],[W.Msg.TEXT_TRIM_LEFT,"lstrip"],[W.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(_e),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(W.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new W.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(W.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:W.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:W.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:W.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},fe={init:function(){this.setColour(_e),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new W.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new W.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ai={init:function(){this.setColour(gi),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(W.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Li={init:function(){this.setColour(gi),this.appendDummyInput().appendField(W.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Si={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_KEYS),this.setTooltip(W.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ni={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(W.Msg.DICTS_GET_TOOLTIP)}},Di={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(W.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(W.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},fi={init:function(){this.setColour(gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(W.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Pi={init:function(){this.setColour(gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_DELETE_TOOLTIP)}},Fi={init:function(){this.setColour(gi),this.appendValueInput("DICT2").setCheck("Dict").appendField(W.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(W.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(W.Msg.MIXLY_MID),this.setTooltip(W.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_CLEAR),this.setTooltip(W.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_ITEMS),this.setTooltip(W.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Vi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_VALUES),this.setTooltip(W.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},bi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.MIXLY_LENGTH),this.setTooltip(W.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Xi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_DELDICT),this.setTooltip(W.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yi={init:function(){this.MODE=[[W.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[W.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(W.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=W.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=W.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==W.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new W.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Ui={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.setTooltip(W.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Bi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(W.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Gi={init:function(){this.setColour(gi),this.appendDummyInput("").appendField(new W.FieldLabel(W.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new W.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(W.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wi={init:function(){this.setColour(gi),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.MIXLY_TO_JSON),this.setTooltip(W.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hi={init:function(){this.setColour(gi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(W.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(W.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},xi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi=210,Ki={init:function(){var t=W.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:W.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:W.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:W.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:W.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:W.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:W.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Ji={init:function(){var t=W.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=W.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new W.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ji={init:function(){var t=[[W.Msg.LOGIC_OPERATION_AND,"AND"],[W.Msg.LOGIC_OPERATION_OR,"OR"],[W.Msg.LOGIC_OPERATION_NOR,"NOR"],[W.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:W.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:W.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:W.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:W.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Qi={init:function(){this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(W.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(W.Msg.LOGIC_NEGATE_TOOLTIP)}},qi={init:function(){var t=[[W.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[W.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new W.FieldDropdown(t),"BOOL"),this.setTooltip(W.Msg.LOGIC_BOOLEAN_TOOLTIP)}},zi={init:function(){this.setColour(Wi),this.setOutput(!0),this.appendDummyInput().appendField(W.Msg.LOGIC_NULL),this.setTooltip(W.Msg.LOGIC_NULL_TOOLTIP)}},Zi={init:function(){this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").appendField(W.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(W.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},$i={init:function(){var t=[[W.Msg.TEXT_APPEND_TO,"in"],[W.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new W.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(W.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(W.Msg.IN)}},tn={init:function(){var t=[[W.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[W.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},en={init:function(){this.setColour(Wi),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},nn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(W.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},on={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG,_=W.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},_n={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(W.Msg.MIXPY_TEXT_ENCODE).appendField(new W.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG,_=W.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},un={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:W.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(W.Msg.MICROBIT_PYTHON_TYPE)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.HTML_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},dn={init:function(){this.setColour(0),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const hn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+W.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+W.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},On={init:function(){this.setColour(0),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},En={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(W.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+W.Msg.MIXLY_ESP32_SET+{mkdir:W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(W.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.HTML_FILE,"isfile"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},An={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(W.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(W.Msg.MIXLY_SETUP+W.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(W.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ln={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(W.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Sn={};Sn.NAME_TYPE=W.PROCEDURE_CATEGORY_NAME,Sn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(W.Msg.MIXLY_AIP_ATTR).setAlign(W.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},gs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_FORM_CONTENT).appendField(new W.FieldDropdown([[W.Msg.HTML_TEXT,"text"],[W.Msg.HTML_EMAIL,"email"],[W.Msg.HTML_NUMBER,"number"],[W.Msg.HTML_PASSWORD,"password"],[W.Msg.HTML_CHECKBOX,"checkbox"],[W.Msg.HTML_RADIOBUTTON,"radiobutton"],[W.Msg.HTML_BUTTON,"button"],[W.Msg.HTML_COLOUR,"colour"],[W.Msg.HTML_DATE,"date"],[W.Msg.HTML_LOCALTIME,"local time"],[W.Msg.HTML_FILE,"file"],[W.Msg.HTML_HIDDEN,"hidden"],[W.Msg.HTML_IMAGE,"image"],[W.Msg.HTML_MONTH,"month"],[W.Msg.HTML_RANGE,"range"],[W.Msg.HTML_RESET,"reset"],[W.Msg.HTML_SEARCH,"search"],[W.Msg.HTML_SUBMIT,"submit"],[W.Msg.HTML_TELEPHONENUMBER,"telephone number"],[W.Msg.HTML_TIME,"time"],[W.Msg.HTML_URL,"url"],[W.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(W.Msg.HTML_NAME).appendField(new W.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(W.Msg.HTML_VALUE).appendField(new W.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(W.Msg.MIXLY_AIP_ATTR).setAlign(W.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(new W.FieldTextInput("property"),"KEY").appendField(":").appendField(new W.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},As={init:function(){this.setColour(hs),this.appendDummyInput().appendField(new W.FieldTextInput("property"),"KEY").appendField(":").appendField(new W.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ls={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_TEXT).appendField(new W.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss=160,Ns={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new W.FieldTable(""),"TEXT")}},Ds={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new W.FieldMultilineInput(""),"TEXT")}},fs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new W.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Ps={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Fs={init:function(){this.setColour(Ss),this.appendDummyInput().appendTitle("Comment:").appendTitle(new W.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},vs={init:function(){this.setColour(Ss),this.appendValueInput("VALUE").appendField(W.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ys={init:function(){this.setColour(Ss),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(W.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=W.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+r()+"("+t+", "+e+", "+i+")"},W.isNumber(n)&&W.isNumber(s)&&W.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Cu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Au=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Lu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Su=function(t,e){return["None",e.ORDER_ATOMIC]},Nu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Du=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},fu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Pu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Fu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},vu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Yu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Vu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},bu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Xu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},yu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Uu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Bu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Gu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},wu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ku=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Hu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},xu=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ku=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ju=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ju=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Qu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},qu=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},zu=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Zu=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},$u=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},ta=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),W.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Va=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ba=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Xa=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},ya=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ua=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ba=function(t,e){return'"},Ga=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},wa=function(){return this.getFieldValue("TEXT")+"\n"},ka=function(t){return t.getFieldValue("TEXT")+"\n"},Ha=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},xa=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Wa=function(){return""},Ka=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ja=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Qa.scrubNakedValue=function(t){return t+"\n"},Qa.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Qa.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Qa.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=W.utils.string.wrap(o,Qa.COMMENT_WRAP-3),n+=Qa.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const qa={microbit:{description:"microbit_python",digital:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],pwm:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],analog:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P10","10"]],interrupt:[["P0","0"],["P1","1"],["P2","2"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","Image.HEART"],["HEART_SMALL","Image.HEART_SMALL"],["HAPPY","Image.HAPPY"],["SMILE","Image.SMILE"],["SAD","Image.SAD"],["CONFUSED","Image.CONFUSED"],["ANGRY","Image.ANGRY"],["ASLEEP","Image.ASLEEP"],["SURPRISED","Image.SURPRISED"],["SILLY","Image.SILLY"],["FABULOUS","Image.FABULOUS"],["MEH","Image.MEH"],["YES","Image.YES"],["NO","Image.NO"],["CLOCK12","Image.CLOCK12"],["CLOCK11","Image.CLOCK11"],["CLOCK10","Image.CLOCK10"],["CLOCK9","Image.CLOCK9"],["CLOCK8","Image.CLOCK8"],["CLOCK7","Image.CLOCK7"],["CLOCK6","Image.CLOCK6"],["CLOCK5","Image.CLOCK5"],["CLOCK4","Image.CLOCK4"],["CLOCK3","Image.CLOCK3"],["CLOCK2","Image.CLOCK2"],["CLOCK1","Image.CLOCK1"],["ARROW_N","Image.ARROW_N"],["ARROW_NE","Image.ARROW_NE"],["ARROW_E","Image.ARROW_E"],["ARROW_SE","Image.ARROW_SE"],["ARROW_S","Image.ARROW_S"],["ARROW_SW","Image.ARROW_SW"],["ARROW_W","Image.ARROW_W"],["ARROW_NW","Image.ARROW_NW"],["TRIANGLE","Image.TRIANGLE"],["TRIANGLE_LEFT","Image.TRIANGLE_LEFT"],["CHESSBOARD","Image.CHESSBOARD"],["DIAMOND","Image.DIAMOND"],["DIAMOND_SMALL","Image.DIAMOND_SMALL"],["SQUARE","Image.SQUARE"],["SQUARE_SMALL","Image.SQUARE_SMALL"],["RABBIT","Image.RABBIT"],["COW","Image.COW"],["MUSIC_CROTCHET","Image.MUSIC_CROTCHET"],["MUSIC_QUAVER","Image.MUSIC_QUAVER"],["MUSIC_QUAVERS","Image.MUSIC_QUAVERS"],["PITCHFORK","Image.PITCHFORK"],["XMAS","Image.XMAS"],["PACMAN","Image.PACMAN"],["TARGET","Image.TARGET"],["TSHIRT","Image.TSHIRT"],["ROLLERSKATE","Image.ROLLERSKATE"],["DUCK","Image.DUCK"],["HOUSE","Image.HOUSE"],["TORTOISE","Image.TORTOISE"],["BUTTERFLY","Image.BUTTERFLY"],["STICKFIGURE","Image.STICKFIGURE"],["GHOST","Image.GHOST"],["SWORD","Image.SWORD"],["GIRAFFE","Image.GIRAFFE"],["SKULL","Image.SKULL"],["UMBRELLA","Image.UMBRELLA"],["SNAKE","Image.SNAKE"],["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],imglist:[["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["P0","0"],["P1","1"],["P2","2"],["P8","8"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]]}};qa["BBC micro:bit"]=qa.microbit;const za=qa,Za=100,$a={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",message0:W.Msg.MIXLY_MICROBIT_Play_built_in_melody,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Play_built_in_melody1)}},tr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",tooltip:"Play one of the built-in melodies. Indicate if you need to wait before continuing or continuously loop the melody.",message0:W.Msg.MIXLY_MICROBIT_Play_built_in_melody_easy,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"}]})}},er={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_TONE).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MIXLY_FREQUENCY),this.appendValueInput("duration").setCheck(Number).appendField(W.Msg.MIXLY_DURATION),this.appendDummyInput("").appendField(W.Msg.MIXLY_MILLIS).appendField(W.Msg.MIXLY_MICROBIT_WAIT),this.appendDummyInput("").appendField(new W.FieldCheckbox(!0),"wait"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},ir={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_TONE).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},nr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",message0:W.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Play_notes1)}},sr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",tooltip:"Play a list of notes expressed in the special music language. Indicate if you need to wait before continuing or continuously loop the melody.",message0:W.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{type:"input_dummy"},{type:"input_dummy"}]})}},or={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.reset",message0:W.Msg.MIXLY_MICROBIT_Reset_music}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Reset_music)}},_r={init:function(){this.setColour(Za),this.appendValueInput("PIN").appendField(W.Msg.MIXLY_NOTONE).appendField(W.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_NOTONE)}},ur={init:function(){this.jsonInit({colour:Za,output:"Array",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.get_tempo",message0:W.Msg.MIXLY_MICROBIT_Get_current_tempo}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Get_current_tempo)}},ar={init:function(){this.setColour(Za),this.appendValueInput("TICKS").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(W.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(W.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_SET_TEMPO1)}},rr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,"say"],[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,"sing"],[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE,"pronounce"]]),"MODE"),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_pitch),this.appendValueInput("speed").setCheck(Number).appendField(W.Msg.MIXLY_SPEED),this.appendValueInput("mouth").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_mouth),this.appendValueInput("throat").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_throat),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH,n=W.Msg.MIXLY_MICROBIT_TYPE_STRING;return i+{say:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,sing:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,pronounce:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE}[e]+n}))}},pr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MICROBIT_SPEECH_translation),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.MICROBIT_SPEECH_translation)}},dr={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_SERVO).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERVO_MOVE)}},hr={init:function(){this.appendValueInput("speed").setCheck(null).appendField(W.Msg.MIXLY_MOTOR).appendField(new W.FieldDropdown([["M1","1"],["M2","2"],["M3","3"],["M4","4"]]),"Motor").appendField(W.Msg.MIXLY_SPEED),this.appendDummyInput().appendField(new W.FieldDropdown([["Forward","1*"],["Reverse","-1*"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Za),this.setTooltip(""),this.setHelpUrl("")}},Mr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_RGB_PIN_COUNT)}},mr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(W.Msg.MIXLY_RGB_NUM_R_G_B)}},cr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").setAlign(W.inputs.Align.RIGHT).appendField(new W.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Or={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendDummyInput().appendField(W.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(W.Msg.MIXLY_ESP32_MUSIC_WRI)}},Er={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_SETUP+" "+W.Msg.QJ00X_MP3),this.appendValueInput("RX").setAlign(W.inputs.Align.RIGHT).appendField("TX#"),this.appendValueInput("TX").setAlign(W.inputs.Align.RIGHT).appendField("RX#"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Rr=[[W.Msg.MIXLY_MP3_PLAY,"play"],[W.Msg.MIXLY_MP3_PAUSE,"pause"],[W.Msg.MIXLY_MP3_NEXT,"next_track"],[W.Msg.MIXLY_MP3_PREV,"prev_track"],[W.Msg.MIXLY_MP3_VOL_UP,"inc_vol"],[W.Msg.MIXLY_MP3_VOL_DOWN,"dec_vol"]];const gr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Rr),"CONTROL_TYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Cr=[[W.Msg.MIXLY_MP3_LOOP_ALL,"0"],[W.Msg.MIXLY_MP3_LOOP_FOLDER,"1"],[W.Msg.MIXLY_MP3_LOOP_ONE,"2"],[W.Msg.MIXLY_MP3_LOOP_RAM,"3"]];const Ar={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_LOOP_MODE).appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Cr),"LOOP_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Lr=[[W.Msg.MIXLY_MP3_EQ_NORMAL,"0"],[W.Msg.MIXLY_MP3_EQ_POP,"1"],[W.Msg.MIXLY_MP3_EQ_ROCK,"2"],[W.Msg.MIXLY_MP3_EQ_JAZZ,"3"],[W.Msg.MIXLY_MP3_EQ_CLASSIC,"4"],[W.Msg.MIXLY_MP3_EQ_BASS,"5"]];const Sr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_EQ_MODE).appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Lr),"EQ_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Nr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_VOL),this.appendValueInput("vol",Number).appendField(W.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Dr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},fr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendValueInput("FOLDER",Number).appendField(W.Msg.DFPLAYER_MINI_FOLDER).setCheck(Number),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Pr=140,Fr={init:function(){this.setColour(225),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"on"],[W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"off"],[W.Msg.HTML_RESET,"reset"]]),"type").appendField(W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type"),i=W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI;return{on:W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,off:W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,reset:W.Blockly.Msg.HTML_RESET}[e]+i}))}},vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.on",tooltip:"Turn on the radio. This needs to be explicitly called since the radio draws power and takes up memory that you may otherwise need.",message0:W.Msg.MIXLY_MICROBIT_Switch_on_radio})}},Yr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.off",tooltip:"Turn off the radio, thus saving power and memory.",message0:W.Msg.MIXLY_MICROBIT_Switch_off_radio})}},Vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.config",tooltip:W.Msg.MIXLY_MICROBIT_Configure_radio1,message0:W.Msg.MIXLY_MICROBIT_Configure_radio,args0:[{min:4,value:32,type:"input_value",max:251,name:"length"},{type:"input_dummy"},{min:1,value:3,type:"input_value",max:32,name:"queue"},{type:"input_dummy"},{min:0,value:7,type:"input_value",max:100,name:"channel"},{type:"input_dummy"},{name:"power",type:"input_value"},{type:"input_dummy"},{name:"address",type:"input_value"},{type:"input_dummy"},{name:"group",type:"input_value"},{type:"input_dummy"},{name:"data_rate",type:"input_value"}]})}},br={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.reset",tooltip:"Reset the radio to default settings.",message0:W.Msg.MIXLY_MICROBIT_Reset_radio})}},Xr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.send",tooltip:"Broadcast a text message.",message0:W.Msg.MIXLY_MICROBIT_Send_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},yr={init:function(){this.setColour(225),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_RADIO_SEND),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_MSG,"send"],[W.Msg.MIXLY_MICROBIT_MSG_BYTE,"send_bytes"]]),"type"),this.appendValueInput("data"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_Send_message1)}},Ur={init:function(){this.jsonInit({colour:225,output:"String",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.receive",tooltip:W.Msg.MIXLY_MICROBIT_Receive_message,message0:W.Msg.MIXLY_MICROBIT_Receive_message})}},Br={init:function(){this.setColour(225),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_Receive_message),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_MSG,"receive"],[W.Msg.MIXLY_MICROBIT_MSG_BYTE,"receive_bytes"],[W.Msg.MIXLY_MICROBIT_MSG_FULL,"receive_full"]]),"type"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_Receive_message)}},Gr={init:function(){this.setColour(Pr),this.appendValueInput("RX",Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_SETUP).appendField("sda").setCheck(Number).setAlign(W.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("scl").setCheck(Number).setAlign(W.inputs.Align.RIGHT),this.appendValueInput("freq").setCheck(Number).appendField("频率").setAlign(W.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(Pr),this.appendValueInput("address").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_READ_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.LANG_MATH_BYTE),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new W.FieldCheckbox(!1),"is_repeated"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_I2C_READ)}},kr={init:function(){this.setColour(Pr),this.appendValueInput("address").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_WRITE_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new W.FieldCheckbox(!1),"is_repeated"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_I2C_WRITE)}},Hr={init:function(){this.jsonInit({colour:Pr,nextStatement:null,previousStatement:null,message0:W.Msg.MIXLY_MICROBIT_SPI_INIT,args0:[{value:1e6,type:"field_number",name:"freq"},{type:"input_dummy"},{value:8,type:"field_number",name:"bits"},{type:"input_dummy"},{value:0,type:"field_number",name:"mode"},{type:"input_dummy"},{name:"mosi",options:K.Profile.default.digital,type:"field_dropdown"},{name:"miso",options:K.Profile.default.digital,type:"field_dropdown"},{name:"sck",options:K.Profile.default.digital,type:"field_dropdown"}]}),this.setFieldValue("15","mosi"),this.setFieldValue("14","miso"),this.setFieldValue("13","sck")}},xr={init:function(){this.setColour(Pr),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_SPI_WRITE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_SPI_WRITE)}},Wr=180,Kr={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:W.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Clear_display)}},Jr={init:function(){this.setColour(Wr),this.appendValueInput("x").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_GET).appendField(W.Msg.MIXLY_BRIGHTNESS).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_BRIGHTNESS1)}},jr={init:function(){this.setColour(Wr),this.appendValueInput("x").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SET_BRIGHTNESS).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("brightness").setCheck(Number).appendField(W.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_BRIGHTNESS2)}},Qr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck([String,"microbit_image"]).appendField(W.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING)}},qr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("delay").setCheck(null).appendField(W.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(W.Msg.MIXLY_MILLIS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zr={init:function(){this.setColour(Wr),this.appendValueInput("PIN",String).setCheck("microbit_image").appendField(W.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.OLED_BITMAP)}},$r={init:function(){this.jsonInit({colour:Wr,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:W.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}]})}},tp={init:function(){this.jsonInit({colour:Wr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:W.Msg.MIXLY_MICROBIT_Animate_images_or_string,args0:[{check:[String,"List"],type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+W.Msg.MIXLY_MICROBIT_Animate_images1)}},ep={init:function(){this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.jsonInit({colour:Wr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:W.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING)}},ip={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:W.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},np={init:function(){this.setColour(Wr),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[W.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(W.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=W.Msg.MIXLY_MICROBIT_monitor;return{on:W.Msg.MIXLY_MICROBIT_Turn_on_display,off:W.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},sp={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:W.Msg.MIXLY_MICROBIT_Turn_off_display})}},op={init:function(){this.jsonInit({colour:Wr,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:W.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Display_is_on1)}},_p={init:function(){this.jsonInit({colour:Wr,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}],output:["microbit_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:W.Msg.MIXLY_MICROBIT_Built_in_image1,message0:W.Msg.MIXLY_MICROBIT_Built_in_image})}},up={init:function(){this.jsonInit({colour:Wr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.copy",message0:W.Msg.MIXLY_MICROBIT_Copy_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Copy_image1)}},ap={init:function(){this.jsonInit({colour:Wr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.invert",message0:W.Msg.MIXLY_MICROBIT_Invert_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Invert_image1)}},rp={init:function(){this.jsonInit({colour:Wr,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:W.Msg.MIXLY_MICROBIT_Create_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Create_image1)}},pp={init:function(){var t=[[W.Msg.MIXLY_UP,"up"],[W.Msg.MIXLY_DOWN,"down"],[W.Msg.MIXLY_LEFT,"left"],[W.Msg.MIXLY_RIGHT,"right"]];this.setColour(Wr),this.setOutput(!0,"microbit_image"),this.setInputsInline(!0),this.appendValueInput("img").appendField(W.Msg.DISPLAY_IMAGE_LET).setCheck(["microbit_image","List",String]),this.appendDummyInput("").appendField(W.Msg.DISPLAY_IMAGE_LET2).appendField(new W.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(W.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(W.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=W.Msg.DISPLAY_IMAGE_LET,n=W.Msg.DISPLAY_IMAGE_LET2,s=W.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:W.Msg.MIXLY_UP,down:W.Msg.MIXLY_DOWN,left:W.Msg.MIXLY_LEFT,right:W.Msg.MIXLY_RIGHT}[t]+s}))}},lp={init:function(){var t=[[W.Msg.MICROBIT_DISPLAY_UNION,"+"],[W.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(Wr),this.setOutput(!0,"microbit_image"),this.appendValueInput("A").appendField(W.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":W.Msg.MIXLY_MICROBIT_image_add,"-":W.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},Ip={init:function(){this.setColour(Wr),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(W.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},Tp={init:function(){this.setColour(Wr),this.appendValueInput("device").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_SETUP).appendField(W.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(W.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_SETUP+W.Msg.MIXLY_DF_LCD+W.Msg.MIXLY_LCD_ADDRESS)}},dp={init:function(){this.setColour(Wr),this.appendValueInput("row",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(W.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},hp={init:function(){this.setColour(Wr),this.appendDummyInput().appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new W.FieldDropdown([[W.Msg.MIXLY_ON,"on()"],[W.Msg.MIXLY_OFF,"off()"],[W.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[W.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(False)"],[W.Msg.MIXLY_LCD_BACKLIGHT,"backlight(True)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return W.Msg.LISTS_SET_INDEX_SET+W.Msg.MIXLY_DF_LCD+{"on()":W.Msg.MIXLY_ON,"off()":W.Msg.MIXLY_OFF,"clear()":W.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":W.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":W.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},Mp={init:function(){this.appendDummyInput().appendField(W.Msg.MIXLY_DF_LCD+" OLED "+W.Msg.OLEDDISPLAY),this.appendValueInput("Text_line1","String").setAlign(W.inputs.Align.RIGHT).appendField("(128*64) "+W.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Wr),this.setTooltip(W.Msg.MIXLY_DF_LCD+W.Msg.OLEDDISPLAY+W.Msg.MIXLY_MICROBIT_TYPE_STRING)}},mp={init:function(){var t=[[W.Msg.MIXLY_HEIGHT,"height"],[W.Msg.MIXLY_WIDTH,"width"]];this.setColour(Wr),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+W.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("microbit_image"),this.appendDummyInput("").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+W.Msg.MIXLY_MICROBIT_IMAGE+{height:W.Msg.MIXLY_HEIGHT,width:W.Msg.MIXLY_WIDTH}[t]}))}},cp={init:function(){this.setColour(Wr),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[W.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:W.Msg.MIXLY_LCD_STAT_CLEAR,1:W.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return W.Msg.MIXLY_DF_LCD+i[e]}))}},Op="#777777",Ep={init:function(){this.setColour(Op),this.appendDummyInput("").appendField("from ").appendField(new W.FieldTextInput("microbit"),"path").appendField(" import ").appendField(new W.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rp={init:function(){this.setColour(Op),this.appendDummyInput("").appendField("import ").appendField(new W.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gp={init:function(){this.setColour(Op),this.appendDummyInput("").appendField(new W.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e 0:\n pre = bin(value).count("1")\n # find first non full high value afterwards\n try:\n k, value = next((ind, v)\n for ind, v in enumerate(resp[i:length - 2]) if resp[i + ind + 1] == 0)\n post = bin(value).count("1") if k else 0\n k = k + i\n except StopIteration:\n i = -1\n dist= -1 if i < 0 else round((pre + (k - i) * 8. + post) * 8 * 0.172)\n return dist\n\n def distance_cm(self):\n return self.distance_mm() / 10.0\n\nsonar=HCSR04()\n\n',["sonar.distance_cm()",e.ORDER_ATOMIC]},Td=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *"},dd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *";var i=this.getFieldValue("TIME_TYPE");switch(i){case"Year":case"Month":case"Day":case"Hour":case"Minute":case"Second":case"Week":return["ds."+i+"()",e.ORDER_ASSIGNMENT];case"Mix1":return["ds.get_date()",e.ORDER_ASSIGNMENT];case"Mix2":return["ds.get_time()",e.ORDER_ASSIGNMENT]}},hd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_time("+e.valueToCode(this,"hour",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"minute",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"second",e.ORDER_ASSIGNMENT)+")\n"},Md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_date("+e.valueToCode(this,"year",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"month",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"day",e.ORDER_ASSIGNMENT)+")\n"},md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.clear_calibration()\n"},cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.read_light_level()",e.ORDER_ATOMIC]},Od=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="from ultrasonic import *","sonar = HCSR04(tpin=pin"+i+", epin=pin"+n+")\n"},Ed=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_TCS="from TCS import *",["tcs.getRawRGBData("+this.getFieldValue("TCS34725_COLOR")+")",e.ORDER_ATOMIC]},Rd=function(t,e){var i=this.getFieldValue("PIN"),n=e.valueToCode(this,"NominalResistance",e.ORDER_ATOMIC),s=e.valueToCode(this,"betaCoefficient",e.ORDER_ATOMIC),o=e.valueToCode(this,"seriesResistor",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ntc="import ntc",["ntc.read(pin"+i+", "+n+", "+s+", "+o+")",e.ORDER_ATOMIC]},gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+"))\n"},Cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+")+'\\r\\n')\n"},Ad=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str(hex("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||"0")+")) + '\\r\\n')\n"},Ld=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"char_marker",e.ORDER_ATOMIC)||";",n=e.statementToCode(this,"DO");e.definitions_["func_serial_receive_data_event_"+i.charCodeAt(1)]="serial.onDataReceived("+i+", () => {\n"+n+"}\n"},Sd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.any()",e.ORDER_ATOMIC]},Nd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.read()",e.ORDER_ATOMIC]},Dd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.readline()",e.ORDER_ATOMIC]},fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["serial.readUntil("+this.getFieldValue("char_marker")+")",e.ORDER_ATOMIC]},Pd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"RX",e.ORDER_ATOMIC),n=e.valueToCode(this,"TX",e.ORDER_ATOMIC);return isNaN(parseInt(i))||(i="pin"+i),isNaN(parseInt(n))||(n="pin"+n),"uart.init(rx="+i+", tx="+n+", baudrate="+this.getFieldValue("baudrate")+")\n"},Fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.init(baudrate="+this.getFieldValue("baudrate")+")\n"},vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},Yd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},Vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},bd=function(t,e){return"control.inBackground(() => {\n"+e.statementToCode(this,"do")+"})\n"},Xd=function(){return"control.reset()\n"},yd=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||K.Profile.default.serial)+")\n"},Ud=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||K.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||K.Profile.default.serial)+")\n"},Bd=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||K.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||K.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Gd=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},wd=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},kd=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Hd=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},xd=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Wd=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Jd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},jd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["running_time()",e.ORDER_ATOMIC]},Qd=function(){return"while True:\n pass\n"},qd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","reset()\n"},zd=function(t,e){return e.definitions_.import_os="import os",["os.uname()",e.ORDER_ATOMIC]};Object.assign(W.Variables,j),Object.assign(W.Procedures,Nn),W.Python=Qa,W.generator=Qa,K.Profile.default={},Object.assign(K.Profile,za),Object.assign(K.Profile.default,za.microbit),Object.assign(W.Blocks,e,i,n,s,o,_,u,a,r,p,l,I,T,N,D,f,P,F,v,Y,V,b),Object.assign(W.Python.forBlock,d,h,M,m,c,O,E,R,g,C,A,L,S,X,y,U,B,G,w,k,H,x)})(); \ No newline at end of file +class Q{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(W.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(W.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(W.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(W.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(at),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.PYTHON_RANGE).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ht={init:function(){this.setColour(at),this.appendValueInput("LIST").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(W.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return W.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mt={init:function(){this.setColour(at),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(W.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new W.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(W.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:W.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:W.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},mt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(W.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(at);var t=new W.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:W.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:W.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Ot={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new W.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return W.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Et={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new W.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return W.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Mt.OPERATORS=[[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ct.OPERATORS=[[W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[W.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Rt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(W.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},gt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Ct={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(W.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},At={init:function(){this.setColour(at),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Lt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},St={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(W.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Nt={init:function(){this.jsonInit({message0:W.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:at,tooltip:W.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:W.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Dt={init:function(){this.setColour(at),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(W.Msg.MIXLY_STAT),this.setOutput(!0)}},ft={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Pt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Ft={init:function(){this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT+W.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(W.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new W.FieldDropdown([[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[W.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(at),this.setTooltip("do-while loop"),this.setHelpUrl("")}},vt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Vt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},bt={init:function(){this.setColour(at),this.appendDummyInput().appendField(W.Msg.MIXLY_GET+W.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_GET_UNIQUE_IDEN)}},Xt={init:function(){this.setColour(at),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(W.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},yt=230;W.FieldTextInput.math_number_validator=function(t){return String(t)},W.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Ut={init:function(){this.setColour(yt),this.appendDummyInput().appendField(new W.FieldTextInput("0",W.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(W.Msg.MATH_NUMBER_TOOLTIP)}},Bt={init:function(){this.setColour(yt);this.appendDummyInput("").appendField(W.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new W.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Gt={init:function(){this.setColour(yt);this.appendDummyInput("").appendField(W.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new W.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:W.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},wt={init:function(){this.setColour(yt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:W.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:W.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:W.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:W.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:W.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(yt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:W.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:W.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:W.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:W.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:W.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:W.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ht={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new W.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},xt={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new W.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:W.Msg.MATH_TRIG_TOOLTIP_SIN,COS:W.Msg.MATH_TRIG_TOOLTIP_COS,TAN:W.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:W.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:W.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:W.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:W.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Wt={init:function(){var t=[[W.Msg.MATH_BIN,"bin"],[W.Msg.MATH_OCT,"oct"],[W.Msg.MATH_HEX,"hex"]];this.setColour(yt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new W.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:W.Msg.MATH_DEC_TOOLTIP_BIN,oct:W.Msg.MATH_DEC_TOOLTIP_OCT,hex:W.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Kt={init:function(){var t=[[W.Msg.LANG_MATH_TO_ROUND,"round"],[W.Msg.LANG_MATH_TO_CEIL,"ceil"],[W.Msg.LANG_MATH_TO_FLOOR,"floor"],[W.Msg.MATH_ABS,"fabs"],[W.Msg.MATH_SQRT,"sqrt"]];this.setColour(yt),this.appendValueInput("A").setCheck(Number).appendField(new W.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:W.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:W.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:W.Msg.MATH_SINGLE_TOOLTIP_SQ,round:W.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:W.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:W.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Jt={init:function(){var t=[[W.Msg.MIXLY_MAX,"max"],[W.Msg.MIXLY_MIN,"min"]];this.setColour(yt),this.appendValueInput("A").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(new W.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(W.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:W.Msg.MIXLY_TOOLTIP_MATH_MAX,min:W.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},jt={init:function(){var t=[[W.Msg.MATH_TWO,"two"],[W.Msg.MATH_EIGHT,"eight"],[W.Msg.MATH_TEN,"ten"],[W.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(yt),this.appendDummyInput("").appendField(W.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new W.FieldDropdown(t),"OP").appendField(W.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(W.Msg.MATH_ZHW).appendField(new W.FieldDropdown(t),"OP2").appendField(W.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:W.Msg.MATH_Before_two,eight:W.Msg.MATH_Before_eight,ten:W.Msg.MATH_Before_ten,sixteen:W.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:W.Msg.MATH_Behind_two,eight:W.Msg.MATH_Behind_eight,ten:W.Msg.MATH_Behind_ten,sixteen:W.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Qt={init:function(){var t=[[W.Msg.LANG_MATH_INT,"int"],[W.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(yt),this.setOutput(!0,Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_RANDOM).appendField(new W.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(W.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:W.Msg.LANG_MATH_INT,float:W.Msg.LANG_MATH_FLOAT_RANDOM};return W.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},qt={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(W.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(W.Msg.MATH_CONSTRAIN_TOOLTIP)}},zt={init:function(){this.setColour(yt),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(W.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(W.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Zt={init:function(){this.setColour(yt),this.appendDummyInput().appendField(new W.FieldTextInput("0",W.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(W.Msg.MATH_NUMBER_TOOLTIP)}},$t={init:function(){this.setColour(yt),this.appendValueInput("NUM").setCheck(Number).appendField(W.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},te={init:function(){this.setColour(yt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(W.Msg.MATH_ROUND).appendField(W.Msg.TEXT_KEEP),this.appendDummyInput().appendField(W.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(W.Msg.MATH_ROUND_NEW_TOOLTIP)}},ee={init:function(){var t=[[W.Msg.MIXLY_TO_INT,"int"],[W.Msg.MIXLY_TO_FLOAT,"float"],[W.Msg.MIXLY_TO_BITES,"b"],[W.Msg.LANG_MATH_BYTE+W.Msg.MIXLY_TO_INT,"bti"]];this.setColour(yt),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:W.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:W.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:W.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ie={init:function(){var t=[[W.Msg.MIXLY_TO_INT,"int"],[W.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(yt),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:W.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:W.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ne=zt,se={init:function(){this.setColour(yt),this.appendValueInput("VAR").appendField(W.Msg.LANG_MATH_BYTE+W.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},oe={init:function(){this.setColour(yt),this.itemCount_=1,this.setMutator(new W.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(W.Msg.MIXLY_PRODUCT+W.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(W.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(W.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const re={init:function(){this.setColour(_e),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new W.FieldTextInput("",W.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(W.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new W.FieldImage(e,7,12,'"')}},pe={init:function(){this.setColour(_e),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(W.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},le={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(Number).appendField(W.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ie={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Te={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},de={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},he={init:function(){this.WHERE_OPTIONS=[[W.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[W.Msg.TEXT_GET_INDEX_RANDOM+1+W.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(W.Msg.LISTS_GET_INDEX_GET,"MODE"),W.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(W.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=W.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+W.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",W.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:W.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:W.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:W.Msg.TEXT_GET_INDEX_RANDOM};return W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+W.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==W.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),W.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(W.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new W.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),W.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Me={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(W.Msg.LISTS_GET_INDEX_GET+" "+W.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(W.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(W.Msg.PROCEDURES_DEFRETURN_RETURN+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.LISTS_GET_INDEX_FROM_START+"n"+W.Msg.TEXT_CHARAT2)}},me={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(W.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(W.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ce={init:function(){this.WHERE_OPTIONS_1=[[W.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[W.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[W.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[W.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[W.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(W.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==W.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==W.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),W.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(W.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new W.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Oe={init:function(){this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(W.Msg.LISTS_GET_INDEX_GET+" "+W.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(W.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(W.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(W.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ee={init:function(){var t=[[W.Msg.MIXLY_EQUALS,"==="],[W.Msg.MIXLY_STARTSWITH,"startswith"],[W.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(_e),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new W.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Re={init:function(){this.setColour(_e),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(W.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_COMPARETO_HELP)}},ge={init:function(){var t=[[W.Msg.TEXT_UPPER,"upper"],[W.Msg.TEXT_TITLE,"title"],[W.Msg.TEXT_CAPITALIZE,"capitalize"],[W.Msg.TEXT_SWAPCASE,"swapcase"],[W.Msg.TEXT_LOWER,"lower"]];this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new W.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:W.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:W.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:W.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:W.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:W.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ce={init:function(){var t=[[W.Msg.TEXT_LJUST,"ljust"],[W.Msg.TEXT_CENTER,"center"],[W.Msg.TEXT_RJUST,"rjust"]];this.setColour(_e),this.appendValueInput("VAR").appendField(new W.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(W.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(W.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ae={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(W.Msg.MIXLY_MID+W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(W.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Le={init:function(){this.setColour(_e),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Se={init:function(){this.setColour(_e),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(W.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(W.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ne={init:function(){this.setColour(_e),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(W.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(W.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},De={init:function(){var t=[[W.Msg.TEXT_TRIM_BOTH,"strip"],[W.Msg.TEXT_TRIM_LEFT,"lstrip"],[W.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(_e),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(W.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new W.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(W.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:W.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:W.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:W.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},fe={init:function(){this.setColour(_e),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new W.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new W.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ai={init:function(){this.setColour(gi),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(W.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Li={init:function(){this.setColour(gi),this.appendDummyInput().appendField(W.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Si={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_KEYS),this.setTooltip(W.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ni={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(W.Msg.DICTS_GET_TOOLTIP)}},Di={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(W.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(W.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},fi={init:function(){this.setColour(gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(W.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Pi={init:function(){this.setColour(gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(W.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_DELETE_TOOLTIP)}},Fi={init:function(){this.setColour(gi),this.appendValueInput("DICT2").setCheck("Dict").appendField(W.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(W.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(W.Msg.MIXLY_MID),this.setTooltip(W.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_CLEAR),this.setTooltip(W.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_ITEMS),this.setTooltip(W.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Vi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_VALUES),this.setTooltip(W.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},bi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.MIXLY_LENGTH),this.setTooltip(W.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Xi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.DICT_DELDICT),this.setTooltip(W.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yi={init:function(){this.MODE=[[W.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[W.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(W.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(W.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=W.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=W.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==W.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new W.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Ui={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(W.Msg.DICTS_ADD_VALUE),this.setTooltip(W.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Bi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(W.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(W.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Gi={init:function(){this.setColour(gi),this.appendDummyInput("").appendField(new W.FieldLabel(W.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new W.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(W.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wi={init:function(){this.setColour(gi),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(W.Msg.MIXLY_TO_JSON),this.setTooltip(W.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hi={init:function(){this.setColour(gi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(W.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(W.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},xi={init:function(){this.setColour(gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi=210,Ki={init:function(){var t=W.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:W.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:W.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:W.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:W.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:W.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:W.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Ji={init:function(){var t=W.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=W.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new W.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ji={init:function(){var t=[[W.Msg.LOGIC_OPERATION_AND,"AND"],[W.Msg.LOGIC_OPERATION_OR,"OR"],[W.Msg.LOGIC_OPERATION_NOR,"NOR"],[W.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:W.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:W.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:W.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:W.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Qi={init:function(){this.setColour(Wi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(W.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(W.Msg.LOGIC_NEGATE_TOOLTIP)}},qi={init:function(){var t=[[W.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[W.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Wi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new W.FieldDropdown(t),"BOOL"),this.setTooltip(W.Msg.LOGIC_BOOLEAN_TOOLTIP)}},zi={init:function(){this.setColour(Wi),this.setOutput(!0),this.appendDummyInput().appendField(W.Msg.LOGIC_NULL),this.setTooltip(W.Msg.LOGIC_NULL_TOOLTIP)}},Zi={init:function(){this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").appendField(W.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(W.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},$i={init:function(){var t=[[W.Msg.TEXT_APPEND_TO,"in"],[W.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new W.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(W.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(W.Msg.IN)}},tn={init:function(){var t=[[W.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[W.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Wi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},en={init:function(){this.setColour(Wi),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(W.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},nn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(W.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},on={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG,_=W.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},_n={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(W.Msg.MIXPY_TEXT_ENCODE).appendField(new W.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_USE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=W.Msg.MIXLY_BELONG,_=W.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:W.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:W.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:W.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},un={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:W.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:W.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(W.Msg.MICROBIT_PYTHON_TYPE)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.HTML_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},dn={init:function(){this.setColour(0),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const hn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+W.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+W.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:W.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},On={init:function(){this.setColour(0),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},En={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(W.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+W.Msg.MIXLY_ESP32_SET+{mkdir:W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(W.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(W.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.HTML_FILE,"isfile"],[W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+W.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:W.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},An={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(W.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(W.Msg.MIXLY_SETUP+W.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(W.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ln={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(W.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(W.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Sn={};Sn.NAME_TYPE=W.PROCEDURE_CATEGORY_NAME,Sn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(W.Msg.MIXLY_AIP_ATTR).setAlign(W.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},gs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_FORM_CONTENT).appendField(new W.FieldDropdown([[W.Msg.HTML_TEXT,"text"],[W.Msg.HTML_EMAIL,"email"],[W.Msg.HTML_NUMBER,"number"],[W.Msg.HTML_PASSWORD,"password"],[W.Msg.HTML_CHECKBOX,"checkbox"],[W.Msg.HTML_RADIOBUTTON,"radiobutton"],[W.Msg.HTML_BUTTON,"button"],[W.Msg.HTML_COLOUR,"colour"],[W.Msg.HTML_DATE,"date"],[W.Msg.HTML_LOCALTIME,"local time"],[W.Msg.HTML_FILE,"file"],[W.Msg.HTML_HIDDEN,"hidden"],[W.Msg.HTML_IMAGE,"image"],[W.Msg.HTML_MONTH,"month"],[W.Msg.HTML_RANGE,"range"],[W.Msg.HTML_RESET,"reset"],[W.Msg.HTML_SEARCH,"search"],[W.Msg.HTML_SUBMIT,"submit"],[W.Msg.HTML_TELEPHONENUMBER,"telephone number"],[W.Msg.HTML_TIME,"time"],[W.Msg.HTML_URL,"url"],[W.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(W.Msg.HTML_NAME).appendField(new W.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(W.Msg.HTML_VALUE).appendField(new W.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(W.Msg.MIXLY_AIP_ATTR).setAlign(W.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs={init:function(){this.setColour(hs),this.appendDummyInput().appendField(new W.FieldTextInput("property"),"KEY").appendField(":").appendField(new W.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},As={init:function(){this.setColour(hs),this.appendDummyInput().appendField(new W.FieldTextInput("property"),"KEY").appendField(":").appendField(new W.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ls={init:function(){this.setColour(hs),this.appendDummyInput().appendField(W.Msg.HTML_TEXT).appendField(new W.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss=160,Ns={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new W.FieldTable(""),"TEXT")}},Ds={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new W.FieldMultilineInput(""),"TEXT")}},fs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new W.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Ps={init:function(){this.setColour(Ss),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Fs={init:function(){this.setColour(Ss),this.appendDummyInput().appendTitle("Comment:").appendTitle(new W.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},vs={init:function(){this.setColour(Ss),this.appendValueInput("VALUE").appendField(W.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ys={init:function(){this.setColour(Ss),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(W.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=W.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+r()+"("+t+", "+e+", "+i+")"},W.isNumber(n)&&W.isNumber(s)&&W.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Cu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Au=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Lu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Su=function(t,e){return["None",e.ORDER_ATOMIC]},Nu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Du=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},fu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Pu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Fu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},vu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Yu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Vu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},bu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Xu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},yu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Uu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Bu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Gu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},wu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},ku=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Hu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},xu=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Wu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ku=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ju=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ju=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Qu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},qu=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},zu=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Zu=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},$u=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},ta=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),W.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Va=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ba=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Xa=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},ya=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ua=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ba=function(t,e){return'"},Ga=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},wa=function(){return this.getFieldValue("TEXT")+"\n"},ka=function(t){return t.getFieldValue("TEXT")+"\n"},Ha=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},xa=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Wa=function(){return""},Ka=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ja=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Qa.scrubNakedValue=function(t){return t+"\n"},Qa.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Qa.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Qa.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=W.utils.string.wrap(o,Qa.COMMENT_WRAP-3),n+=Qa.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const qa={microbit:{description:"microbit_python",digital:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],pwm:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],analog:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P10","10"]],interrupt:[["P0","0"],["P1","1"],["P2","2"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","Image.HEART"],["HEART_SMALL","Image.HEART_SMALL"],["HAPPY","Image.HAPPY"],["SMILE","Image.SMILE"],["SAD","Image.SAD"],["CONFUSED","Image.CONFUSED"],["ANGRY","Image.ANGRY"],["ASLEEP","Image.ASLEEP"],["SURPRISED","Image.SURPRISED"],["SILLY","Image.SILLY"],["FABULOUS","Image.FABULOUS"],["MEH","Image.MEH"],["YES","Image.YES"],["NO","Image.NO"],["CLOCK12","Image.CLOCK12"],["CLOCK11","Image.CLOCK11"],["CLOCK10","Image.CLOCK10"],["CLOCK9","Image.CLOCK9"],["CLOCK8","Image.CLOCK8"],["CLOCK7","Image.CLOCK7"],["CLOCK6","Image.CLOCK6"],["CLOCK5","Image.CLOCK5"],["CLOCK4","Image.CLOCK4"],["CLOCK3","Image.CLOCK3"],["CLOCK2","Image.CLOCK2"],["CLOCK1","Image.CLOCK1"],["ARROW_N","Image.ARROW_N"],["ARROW_NE","Image.ARROW_NE"],["ARROW_E","Image.ARROW_E"],["ARROW_SE","Image.ARROW_SE"],["ARROW_S","Image.ARROW_S"],["ARROW_SW","Image.ARROW_SW"],["ARROW_W","Image.ARROW_W"],["ARROW_NW","Image.ARROW_NW"],["TRIANGLE","Image.TRIANGLE"],["TRIANGLE_LEFT","Image.TRIANGLE_LEFT"],["CHESSBOARD","Image.CHESSBOARD"],["DIAMOND","Image.DIAMOND"],["DIAMOND_SMALL","Image.DIAMOND_SMALL"],["SQUARE","Image.SQUARE"],["SQUARE_SMALL","Image.SQUARE_SMALL"],["RABBIT","Image.RABBIT"],["COW","Image.COW"],["MUSIC_CROTCHET","Image.MUSIC_CROTCHET"],["MUSIC_QUAVER","Image.MUSIC_QUAVER"],["MUSIC_QUAVERS","Image.MUSIC_QUAVERS"],["PITCHFORK","Image.PITCHFORK"],["XMAS","Image.XMAS"],["PACMAN","Image.PACMAN"],["TARGET","Image.TARGET"],["TSHIRT","Image.TSHIRT"],["ROLLERSKATE","Image.ROLLERSKATE"],["DUCK","Image.DUCK"],["HOUSE","Image.HOUSE"],["TORTOISE","Image.TORTOISE"],["BUTTERFLY","Image.BUTTERFLY"],["STICKFIGURE","Image.STICKFIGURE"],["GHOST","Image.GHOST"],["SWORD","Image.SWORD"],["GIRAFFE","Image.GIRAFFE"],["SKULL","Image.SKULL"],["UMBRELLA","Image.UMBRELLA"],["SNAKE","Image.SNAKE"],["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],imglist:[["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["P0","0"],["P1","1"],["P2","2"],["P8","8"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]]}};qa["BBC micro:bit"]=qa.microbit;const za=qa,Za=100,$a={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",message0:W.Msg.MIXLY_MICROBIT_Play_built_in_melody,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Play_built_in_melody1)}},tr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",tooltip:"Play one of the built-in melodies. Indicate if you need to wait before continuing or continuously loop the melody.",message0:W.Msg.MIXLY_MICROBIT_Play_built_in_melody_easy,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"}]})}},er={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_TONE).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MIXLY_FREQUENCY),this.appendValueInput("duration").setCheck(Number).appendField(W.Msg.MIXLY_DURATION),this.appendDummyInput("").appendField(W.Msg.MIXLY_MILLIS).appendField(W.Msg.MIXLY_MICROBIT_WAIT),this.appendDummyInput("").appendField(new W.FieldCheckbox(!0),"wait"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},ir={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_TONE).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},nr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",message0:W.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Play_notes1)}},sr={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",tooltip:"Play a list of notes expressed in the special music language. Indicate if you need to wait before continuing or continuously loop the melody.",message0:W.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{type:"input_dummy"},{type:"input_dummy"}]})}},or={init:function(){this.jsonInit({colour:Za,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.reset",message0:W.Msg.MIXLY_MICROBIT_Reset_music}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Reset_music)}},_r={init:function(){this.setColour(Za),this.appendValueInput("PIN").appendField(W.Msg.MIXLY_NOTONE).appendField(W.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_NOTONE)}},ur={init:function(){this.jsonInit({colour:Za,output:"Array",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.get_tempo",message0:W.Msg.MIXLY_MICROBIT_Get_current_tempo}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Get_current_tempo)}},ar={init:function(){this.setColour(Za),this.appendValueInput("TICKS").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(W.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(W.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_SET_TEMPO1)}},rr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,"say"],[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,"sing"],[W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE,"pronounce"]]),"MODE"),this.appendValueInput("pitch").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_pitch),this.appendValueInput("speed").setCheck(Number).appendField(W.Msg.MIXLY_SPEED),this.appendValueInput("mouth").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_mouth),this.appendValueInput("throat").setCheck(Number).appendField(W.Msg.MICROBIT_SPEECH_throat),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH,n=W.Msg.MIXLY_MICROBIT_TYPE_STRING;return i+{say:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,sing:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,pronounce:W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE}[e]+n}))}},pr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},lr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ir={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(Za),this.appendValueInput("VAR").setCheck(String).appendField(W.Msg.MICROBIT_SPEECH_translation),this.setOutput(!0,String),this.setTooltip(W.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+W.Msg.MIXLY_MICROBIT_TYPE_STRING+W.Msg.MICROBIT_SPEECH_translation)}},dr={init:function(){this.setColour(Za),this.appendValueInput("PIN",Number).appendField(W.Msg.MIXLY_SERVO).appendField(W.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERVO_MOVE)}},hr={init:function(){this.appendValueInput("speed").setCheck(null).appendField(W.Msg.MIXLY_MOTOR).appendField(new W.FieldDropdown([["M1","1"],["M2","2"],["M3","3"],["M4","4"]]),"Motor").appendField(W.Msg.MIXLY_SPEED),this.appendDummyInput().appendField(new W.FieldDropdown([["Forward","1*"],["Reverse","-1*"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Za),this.setTooltip(""),this.setHelpUrl("")}},Mr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_RGB_PIN_COUNT)}},mr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(W.Msg.MIXLY_RGB_NUM_R_G_B)}},cr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").setAlign(W.inputs.Align.RIGHT).appendField(new W.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Or={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_RGB),this.appendDummyInput().appendField(W.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(W.Msg.MIXLY_ESP32_MUSIC_WRI)}},Er={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.MIXLY_SETUP+" "+W.Msg.QJ00X_MP3),this.appendValueInput("RX").setAlign(W.inputs.Align.RIGHT).appendField("TX#"),this.appendValueInput("TX").setAlign(W.inputs.Align.RIGHT).appendField("RX#"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Rr=[[W.Msg.MIXLY_MP3_PLAY,"play"],[W.Msg.MIXLY_MP3_PAUSE,"pause"],[W.Msg.MIXLY_MP3_NEXT,"next_track"],[W.Msg.MIXLY_MP3_PREV,"prev_track"],[W.Msg.MIXLY_MP3_VOL_UP,"inc_vol"],[W.Msg.MIXLY_MP3_VOL_DOWN,"dec_vol"]];const gr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Rr),"CONTROL_TYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Cr=[[W.Msg.MIXLY_MP3_LOOP_ALL,"0"],[W.Msg.MIXLY_MP3_LOOP_FOLDER,"1"],[W.Msg.MIXLY_MP3_LOOP_ONE,"2"],[W.Msg.MIXLY_MP3_LOOP_RAM,"3"]];const Ar={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_LOOP_MODE).appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Cr),"LOOP_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Lr=[[W.Msg.MIXLY_MP3_EQ_NORMAL,"0"],[W.Msg.MIXLY_MP3_EQ_POP,"1"],[W.Msg.MIXLY_MP3_EQ_ROCK,"2"],[W.Msg.MIXLY_MP3_EQ_JAZZ,"3"],[W.Msg.MIXLY_MP3_EQ_CLASSIC,"4"],[W.Msg.MIXLY_MP3_EQ_BASS,"5"]];const Sr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_EQ_MODE).appendField(W.Msg.MIXLY_STAT).appendField(new W.FieldDropdown(Lr),"EQ_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Nr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(W.Msg.MIXLY_MP3_VOL),this.appendValueInput("vol",Number).appendField(W.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Dr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},fr={init:function(){this.setColour(Za),this.appendDummyInput("").appendField(W.Msg.QJ00X_MP3),this.appendValueInput("FOLDER",Number).appendField(W.Msg.DFPLAYER_MINI_FOLDER).setCheck(Number),this.appendValueInput("NUM",Number).appendField(W.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Pr=140,Fr={init:function(){this.setColour(225),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"on"],[W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"off"],[W.Msg.HTML_RESET,"reset"]]),"type").appendField(W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type"),i=W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI;return{on:W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,off:W.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,reset:W.Blockly.Msg.HTML_RESET}[e]+i}))}},vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.on",tooltip:"Turn on the radio. This needs to be explicitly called since the radio draws power and takes up memory that you may otherwise need.",message0:W.Msg.MIXLY_MICROBIT_Switch_on_radio})}},Yr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.off",tooltip:"Turn off the radio, thus saving power and memory.",message0:W.Msg.MIXLY_MICROBIT_Switch_off_radio})}},Vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.config",tooltip:W.Msg.MIXLY_MICROBIT_Configure_radio1,message0:W.Msg.MIXLY_MICROBIT_Configure_radio,args0:[{min:4,value:32,type:"input_value",max:251,name:"length"},{type:"input_dummy"},{min:1,value:3,type:"input_value",max:32,name:"queue"},{type:"input_dummy"},{min:0,value:7,type:"input_value",max:100,name:"channel"},{type:"input_dummy"},{name:"power",type:"input_value"},{type:"input_dummy"},{name:"address",type:"input_value"},{type:"input_dummy"},{name:"group",type:"input_value"},{type:"input_dummy"},{name:"data_rate",type:"input_value"}]})}},br={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.reset",tooltip:"Reset the radio to default settings.",message0:W.Msg.MIXLY_MICROBIT_Reset_radio})}},Xr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.send",tooltip:"Broadcast a text message.",message0:W.Msg.MIXLY_MICROBIT_Send_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},yr={init:function(){this.setColour(225),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_RADIO_SEND),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_MSG,"send"],[W.Msg.MIXLY_MICROBIT_MSG_BYTE,"send_bytes"]]),"type"),this.appendValueInput("data"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_Send_message1)}},Ur={init:function(){this.jsonInit({colour:225,output:"String",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.receive",tooltip:W.Msg.MIXLY_MICROBIT_Receive_message,message0:W.Msg.MIXLY_MICROBIT_Receive_message})}},Br={init:function(){this.setColour(225),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_Receive_message),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_MSG,"receive"],[W.Msg.MIXLY_MICROBIT_MSG_BYTE,"receive_bytes"],[W.Msg.MIXLY_MICROBIT_MSG_FULL,"receive_full"]]),"type"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_Receive_message)}},Gr={init:function(){this.setColour(Pr),this.appendValueInput("RX",Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_SETUP).appendField("sda").setCheck(Number).setAlign(W.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("scl").setCheck(Number).setAlign(W.inputs.Align.RIGHT),this.appendValueInput("freq").setCheck(Number).appendField("频率").setAlign(W.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},wr={init:function(){this.setColour(Pr),this.appendValueInput("address").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_READ_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.LANG_MATH_BYTE),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new W.FieldCheckbox(!1),"is_repeated"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_I2C_READ)}},kr={init:function(){this.setColour(Pr),this.appendValueInput("address").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_WRITE_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendDummyInput().appendField(W.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new W.FieldCheckbox(!1),"is_repeated"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_I2C_WRITE)}},Hr={init:function(){this.jsonInit({colour:Pr,nextStatement:null,previousStatement:null,message0:W.Msg.MIXLY_MICROBIT_SPI_INIT,args0:[{value:1e6,type:"field_number",name:"freq"},{type:"input_dummy"},{value:8,type:"field_number",name:"bits"},{type:"input_dummy"},{value:0,type:"field_number",name:"mode"},{type:"input_dummy"},{name:"mosi",options:K.Profile.default.digital,type:"field_dropdown"},{name:"miso",options:K.Profile.default.digital,type:"field_dropdown"},{name:"sck",options:K.Profile.default.digital,type:"field_dropdown"}]}),this.setFieldValue("15","mosi"),this.setFieldValue("14","miso"),this.setFieldValue("13","sck")}},xr={init:function(){this.setColour(Pr),this.appendValueInput("data").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_SPI_WRITE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_SPI_WRITE)}},Wr=180,Kr={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:W.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Clear_display)}},Jr={init:function(){this.setColour(Wr),this.appendValueInput("x").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_GET).appendField(W.Msg.MIXLY_BRIGHTNESS).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(W.Msg.MIXLY_BRIGHTNESS1)}},jr={init:function(){this.setColour(Wr),this.appendValueInput("x").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SET_BRIGHTNESS).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("brightness").setCheck(Number).appendField(W.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_BRIGHTNESS2)}},Qr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck([String,"microbit_image"]).appendField(W.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING)}},qr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zr={init:function(){this.setColour(Wr),this.appendValueInput("data").setCheck(String).appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("delay").setCheck(null).appendField(W.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(W.Msg.MIXLY_MILLIS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Zr={init:function(){this.setColour(Wr),this.appendValueInput("PIN",String).setCheck("microbit_image").appendField(W.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.OLED_BITMAP)}},$r={init:function(){this.jsonInit({colour:Wr,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:W.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}]})}},tp={init:function(){this.jsonInit({colour:Wr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:W.Msg.MIXLY_MICROBIT_Animate_images_or_string,args0:[{check:[String,"List"],type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+W.Msg.MIXLY_MICROBIT_Animate_images1)}},ep={init:function(){this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.jsonInit({colour:Wr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:W.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING)}},ip={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:W.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},np={init:function(){this.setColour(Wr),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[W.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(W.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=W.Msg.MIXLY_MICROBIT_monitor;return{on:W.Msg.MIXLY_MICROBIT_Turn_on_display,off:W.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},sp={init:function(){this.jsonInit({colour:Wr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:W.Msg.MIXLY_MICROBIT_Turn_off_display})}},op={init:function(){this.jsonInit({colour:Wr,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:W.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Display_is_on1)}},_p={init:function(){this.jsonInit({colour:Wr,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}],output:["microbit_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:W.Msg.MIXLY_MICROBIT_Built_in_image1,message0:W.Msg.MIXLY_MICROBIT_Built_in_image})}},up={init:function(){this.jsonInit({colour:Wr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.copy",message0:W.Msg.MIXLY_MICROBIT_Copy_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Copy_image1)}},ap={init:function(){this.jsonInit({colour:Wr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.invert",message0:W.Msg.MIXLY_MICROBIT_Invert_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Invert_image1)}},rp={init:function(){this.jsonInit({colour:Wr,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:W.Msg.MIXLY_MICROBIT_Create_image}),this.setTooltip(W.Msg.MIXLY_MICROBIT_Create_image1)}},pp={init:function(){var t=[[W.Msg.MIXLY_UP,"up"],[W.Msg.MIXLY_DOWN,"down"],[W.Msg.MIXLY_LEFT,"left"],[W.Msg.MIXLY_RIGHT,"right"]];this.setColour(Wr),this.setOutput(!0,"microbit_image"),this.setInputsInline(!0),this.appendValueInput("img").appendField(W.Msg.DISPLAY_IMAGE_LET).setCheck(["microbit_image","List",String]),this.appendDummyInput("").appendField(W.Msg.DISPLAY_IMAGE_LET2).appendField(new W.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(W.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(W.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=W.Msg.DISPLAY_IMAGE_LET,n=W.Msg.DISPLAY_IMAGE_LET2,s=W.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:W.Msg.MIXLY_UP,down:W.Msg.MIXLY_DOWN,left:W.Msg.MIXLY_LEFT,right:W.Msg.MIXLY_RIGHT}[t]+s}))}},lp={init:function(){var t=[[W.Msg.MICROBIT_DISPLAY_UNION,"+"],[W.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(Wr),this.setOutput(!0,"microbit_image"),this.appendValueInput("A").appendField(W.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":W.Msg.MIXLY_MICROBIT_image_add,"-":W.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},Ip={init:function(){this.setColour(Wr),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(W.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},Tp={init:function(){this.setColour(Wr),this.appendValueInput("device").setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_SETUP).appendField(W.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(W.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(W.Msg.MIXLY_SETUP+W.Msg.MIXLY_DF_LCD+W.Msg.MIXLY_LCD_ADDRESS)}},dp={init:function(){this.setColour(Wr),this.appendValueInput("row",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(W.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(W.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},hp={init:function(){this.setColour(Wr),this.appendDummyInput().appendField(W.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new W.FieldDropdown([[W.Msg.MIXLY_ON,"on()"],[W.Msg.MIXLY_OFF,"off()"],[W.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[W.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(False)"],[W.Msg.MIXLY_LCD_BACKLIGHT,"backlight(True)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return W.Msg.LISTS_SET_INDEX_SET+W.Msg.MIXLY_DF_LCD+{"on()":W.Msg.MIXLY_ON,"off()":W.Msg.MIXLY_OFF,"clear()":W.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":W.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":W.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},Mp={init:function(){this.appendDummyInput().appendField(W.Msg.MIXLY_DF_LCD+" OLED "+W.Msg.OLEDDISPLAY),this.appendValueInput("Text_line1","String").setAlign(W.inputs.Align.RIGHT).appendField("(128*64) "+W.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(W.inputs.Align.RIGHT).appendField(W.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Wr),this.setTooltip(W.Msg.MIXLY_DF_LCD+W.Msg.OLEDDISPLAY+W.Msg.MIXLY_MICROBIT_TYPE_STRING)}},mp={init:function(){var t=[[W.Msg.MIXLY_HEIGHT,"height"],[W.Msg.MIXLY_WIDTH,"width"]];this.setColour(Wr),this.appendDummyInput().appendField(W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+W.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("microbit_image"),this.appendDummyInput("").appendField(new W.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return W.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+W.Msg.MIXLY_MICROBIT_IMAGE+{height:W.Msg.MIXLY_HEIGHT,width:W.Msg.MIXLY_WIDTH}[t]}))}},cp={init:function(){this.setColour(Wr),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new W.FieldDropdown([[W.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[W.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:W.Msg.MIXLY_LCD_STAT_CLEAR,1:W.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return W.Msg.MIXLY_DF_LCD+i[e]}))}},Op="#777777",Ep={init:function(){this.setColour(Op),this.appendDummyInput("").appendField("from ").appendField(new W.FieldTextInput("microbit"),"path").appendField(" import ").appendField(new W.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rp={init:function(){this.setColour(Op),this.appendDummyInput("").appendField("import ").appendField(new W.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gp={init:function(){this.setColour(Op),this.appendDummyInput("").appendField(new W.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new W.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e 0:\n pre = bin(value).count("1")\n # find first non full high value afterwards\n try:\n k, value = next((ind, v)\n for ind, v in enumerate(resp[i:length - 2]) if resp[i + ind + 1] == 0)\n post = bin(value).count("1") if k else 0\n k = k + i\n except StopIteration:\n i = -1\n dist= -1 if i < 0 else round((pre + (k - i) * 8. + post) * 8 * 0.172)\n return dist\n\n def distance_cm(self):\n return self.distance_mm() / 10.0\n\nsonar=HCSR04()\n\n',["sonar.distance_cm()",e.ORDER_ATOMIC]},Td=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *"},dd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *";var i=this.getFieldValue("TIME_TYPE");switch(i){case"Year":case"Month":case"Day":case"Hour":case"Minute":case"Second":case"Week":return["ds."+i+"()",e.ORDER_ASSIGNMENT];case"Mix1":return["ds.get_date()",e.ORDER_ASSIGNMENT];case"Mix2":return["ds.get_time()",e.ORDER_ASSIGNMENT]}},hd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_time("+e.valueToCode(this,"hour",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"minute",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"second",e.ORDER_ASSIGNMENT)+")\n"},Md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_date("+e.valueToCode(this,"year",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"month",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"day",e.ORDER_ASSIGNMENT)+")\n"},md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.clear_calibration()\n"},cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.read_light_level()",e.ORDER_ATOMIC]},Od=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="from ultrasonic import *","sonar = HCSR04(tpin=pin"+i+", epin=pin"+n+")\n"},Ed=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_TCS="from TCS import *",["tcs.getRawRGBData("+this.getFieldValue("TCS34725_COLOR")+")",e.ORDER_ATOMIC]},Rd=function(t,e){var i=this.getFieldValue("PIN"),n=e.valueToCode(this,"NominalResistance",e.ORDER_ATOMIC),s=e.valueToCode(this,"betaCoefficient",e.ORDER_ATOMIC),o=e.valueToCode(this,"seriesResistor",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ntc="import ntc",["ntc.read(pin"+i+", "+n+", "+s+", "+o+")",e.ORDER_ATOMIC]},gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+"))\n"},Cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+")+'\\r\\n')\n"},Ad=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str(hex("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||"0")+")) + '\\r\\n')\n"},Ld=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"char_marker",e.ORDER_ATOMIC)||";",n=e.statementToCode(this,"DO");e.definitions_["func_serial_receive_data_event_"+i.charCodeAt(1)]="serial.onDataReceived("+i+", () => {\n"+n+"}\n"},Sd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.any()",e.ORDER_ATOMIC]},Nd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.read()",e.ORDER_ATOMIC]},Dd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.readline()",e.ORDER_ATOMIC]},fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["serial.readUntil("+this.getFieldValue("char_marker")+")",e.ORDER_ATOMIC]},Pd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"RX",e.ORDER_ATOMIC),n=e.valueToCode(this,"TX",e.ORDER_ATOMIC);return isNaN(parseInt(i))||(i="pin"+i),isNaN(parseInt(n))||(n="pin"+n),"uart.init(rx="+i+", tx="+n+", baudrate="+this.getFieldValue("baudrate")+")\n"},Fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.init(baudrate="+this.getFieldValue("baudrate")+")\n"},vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},Yd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},Vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},bd=function(t,e){return"control.inBackground(() => {\n"+e.statementToCode(this,"do")+"})\n"},Xd=function(){return"control.reset()\n"},yd=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||K.Profile.default.serial)+")\n"},Ud=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||K.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||K.Profile.default.serial)+")\n"},Bd=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||K.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||K.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},Gd=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},wd=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},kd=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Hd=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},xd=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},Wd=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},Kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Jd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},jd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["running_time()",e.ORDER_ATOMIC]},Qd=function(){return"while True:\n pass\n"},qd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","reset()\n"},zd=function(t,e){return e.definitions_.import_os="import os",["os.uname()",e.ORDER_ATOMIC]};Object.assign(W.Variables,j),Object.assign(W.Procedures,Nn),W.Python=Qa,W.generator=Qa,K.Profile.default={},Object.assign(K.Profile,za),Object.assign(K.Profile.default,za.microbit),Object.assign(W.Blocks,e,i,n,s,o,_,u,a,r,p,l,I,T,N,D,f,P,F,v,Y,V,b),Object.assign(W.Python.forBlock,d,h,M,m,c,O,E,R,g,C,A,L,S,X,y,U,B,G,w,k,H,x)})(); \ No newline at end of file diff --git a/boards/default/micropython_nrf51822_mithoncc/main.bundle.js b/boards/default/micropython_nrf51822_mithoncc/main.bundle.js index 15e26821..51b6078f 100644 --- a/boards/default/micropython_nrf51822_mithoncc/main.bundle.js +++ b/boards/default/micropython_nrf51822_mithoncc/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class z{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(J.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(J.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(J.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(J.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Mt={init:function(){this.setColour(pt),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.PYTHON_RANGE).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},mt={init:function(){this.setColour(pt),this.appendValueInput("LIST").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(J.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return J.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ct={init:function(){this.setColour(pt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(J.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new J.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(J.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:J.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:J.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Ot={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Et={init:function(){this.setColour(pt);var t=new J.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:J.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:J.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Rt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new J.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return J.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},gt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new J.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return J.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};ct.OPERATORS=[[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Et.OPERATORS=[[J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Ct={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(J.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},At={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Lt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(J.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},St={init:function(){this.setColour(pt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Dt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},ft={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Nt={init:function(){this.jsonInit({message0:J.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:pt,tooltip:J.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:J.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Pt={init:function(){this.setColour(pt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_STAT),this.setOutput(!0)}},Ft={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},vt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Yt={init:function(){this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT+J.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(J.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new J.FieldDropdown([[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(pt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},bt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Xt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},yt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET+J.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ut={init:function(){this.setColour(pt),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(J.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Bt=230;J.FieldTextInput.math_number_validator=function(t){return String(t)},J.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Gt={init:function(){this.setColour(Bt),this.appendDummyInput().appendField(new J.FieldTextInput("0",J.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(J.Msg.MATH_NUMBER_TOOLTIP)}},wt={init:function(){this.setColour(Bt);this.appendDummyInput("").appendField(J.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new J.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},kt={init:function(){this.setColour(Bt);this.appendDummyInput("").appendField(J.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new J.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ht={init:function(){this.setColour(Bt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:J.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:J.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:J.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:J.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:J.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},xt={init:function(){this.setColour(Bt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:J.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:J.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:J.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:J.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:J.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Wt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new J.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Kt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new J.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:J.Msg.MATH_TRIG_TOOLTIP_SIN,COS:J.Msg.MATH_TRIG_TOOLTIP_COS,TAN:J.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:J.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:J.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:J.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:J.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Jt={init:function(){var t=[[J.Msg.MATH_BIN,"bin"],[J.Msg.MATH_OCT,"oct"],[J.Msg.MATH_HEX,"hex"]];this.setColour(Bt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new J.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:J.Msg.MATH_DEC_TOOLTIP_BIN,oct:J.Msg.MATH_DEC_TOOLTIP_OCT,hex:J.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},jt={init:function(){var t=[[J.Msg.LANG_MATH_TO_ROUND,"round"],[J.Msg.LANG_MATH_TO_CEIL,"ceil"],[J.Msg.LANG_MATH_TO_FLOOR,"floor"],[J.Msg.MATH_ABS,"fabs"],[J.Msg.MATH_SQRT,"sqrt"]];this.setColour(Bt),this.appendValueInput("A").setCheck(Number).appendField(new J.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:J.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:J.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:J.Msg.MATH_SINGLE_TOOLTIP_SQ,round:J.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:J.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:J.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Qt={init:function(){var t=[[J.Msg.MIXLY_MAX,"max"],[J.Msg.MIXLY_MIN,"min"]];this.setColour(Bt),this.appendValueInput("A").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(new J.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(J.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:J.Msg.MIXLY_TOOLTIP_MATH_MAX,min:J.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},qt={init:function(){var t=[[J.Msg.MATH_TWO,"two"],[J.Msg.MATH_EIGHT,"eight"],[J.Msg.MATH_TEN,"ten"],[J.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Bt),this.appendDummyInput("").appendField(J.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new J.FieldDropdown(t),"OP").appendField(J.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(J.Msg.MATH_ZHW).appendField(new J.FieldDropdown(t),"OP2").appendField(J.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:J.Msg.MATH_Before_two,eight:J.Msg.MATH_Before_eight,ten:J.Msg.MATH_Before_ten,sixteen:J.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:J.Msg.MATH_Behind_two,eight:J.Msg.MATH_Behind_eight,ten:J.Msg.MATH_Behind_ten,sixteen:J.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},zt={init:function(){var t=[[J.Msg.LANG_MATH_INT,"int"],[J.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Bt),this.setOutput(!0,Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_RANDOM).appendField(new J.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:J.Msg.LANG_MATH_INT,float:J.Msg.LANG_MATH_FLOAT_RANDOM};return J.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Zt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(J.Msg.MATH_CONSTRAIN_TOOLTIP)}},$t={init:function(){this.setColour(Bt),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(J.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(J.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_MATH_MAP)}},te={init:function(){this.setColour(Bt),this.appendDummyInput().appendField(new J.FieldTextInput("0",J.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(J.Msg.MATH_NUMBER_TOOLTIP)}},ee={init:function(){this.setColour(Bt),this.appendValueInput("NUM").setCheck(Number).appendField(J.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},ie={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(J.Msg.MATH_ROUND).appendField(J.Msg.TEXT_KEEP),this.appendDummyInput().appendField(J.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(J.Msg.MATH_ROUND_NEW_TOOLTIP)}},ne={init:function(){var t=[[J.Msg.MIXLY_TO_INT,"int"],[J.Msg.MIXLY_TO_FLOAT,"float"],[J.Msg.MIXLY_TO_BITES,"b"],[J.Msg.LANG_MATH_BYTE+J.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Bt),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:J.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:J.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:J.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},se={init:function(){var t=[[J.Msg.MIXLY_TO_INT,"int"],[J.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Bt),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:J.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:J.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},oe=$t,_e={init:function(){this.setColour(Bt),this.appendValueInput("VAR").appendField(J.Msg.LANG_MATH_BYTE+J.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},ue={init:function(){this.setColour(Bt),this.itemCount_=1,this.setMutator(new J.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(J.Msg.MIXLY_PRODUCT+J.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(J.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(J.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const le={init:function(){this.setColour(ae),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new J.FieldTextInput("",J.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(J.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new J.FieldImage(e,7,12,'"')}},Ie={init:function(){this.setColour(ae),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(J.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Te={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(Number).appendField(J.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},de={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},he={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Me={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},me={init:function(){this.WHERE_OPTIONS=[[J.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[J.Msg.TEXT_GET_INDEX_RANDOM+1+J.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(J.Msg.LISTS_GET_INDEX_GET,"MODE"),J.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(J.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+J.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",J.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:J.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:J.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:J.Msg.TEXT_GET_INDEX_RANDOM};return J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+J.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==J.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),J.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(J.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new J.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),J.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},ce={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(J.Msg.LISTS_GET_INDEX_GET+" "+J.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(J.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.LISTS_GET_INDEX_FROM_START+"n"+J.Msg.TEXT_CHARAT2)}},Oe={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(J.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(J.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ee={init:function(){this.WHERE_OPTIONS_1=[[J.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[J.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[J.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[J.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(J.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==J.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==J.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),J.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(J.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new J.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Re={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(J.Msg.LISTS_GET_INDEX_GET+" "+J.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(J.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(J.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(J.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ge={init:function(){var t=[[J.Msg.MIXLY_EQUALS,"==="],[J.Msg.MIXLY_STARTSWITH,"startswith"],[J.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ae),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new J.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ce={init:function(){this.setColour(ae),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(J.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_COMPARETO_HELP)}},Ae={init:function(){var t=[[J.Msg.TEXT_UPPER,"upper"],[J.Msg.TEXT_TITLE,"title"],[J.Msg.TEXT_CAPITALIZE,"capitalize"],[J.Msg.TEXT_SWAPCASE,"swapcase"],[J.Msg.TEXT_LOWER,"lower"]];this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new J.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:J.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:J.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:J.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:J.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:J.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Le={init:function(){var t=[[J.Msg.TEXT_LJUST,"ljust"],[J.Msg.TEXT_CENTER,"center"],[J.Msg.TEXT_RJUST,"rjust"]];this.setColour(ae),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(J.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(J.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Se={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(J.Msg.MIXLY_MID+J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(J.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},De={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},fe={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(J.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(J.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ne={init:function(){this.setColour(ae),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(J.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(J.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Pe={init:function(){var t=[[J.Msg.TEXT_TRIM_BOTH,"strip"],[J.Msg.TEXT_TRIM_LEFT,"lstrip"],[J.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ae),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(J.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new J.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(J.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:J.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:J.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:J.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Fe={init:function(){this.setColour(ae),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new J.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new J.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Si={init:function(){this.setColour(Ai),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(J.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Di={init:function(){this.setColour(Ai),this.appendDummyInput().appendField(J.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},fi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_KEYS),this.setTooltip(J.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ni={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(J.Msg.DICTS_GET_TOOLTIP)}},Pi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(J.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(J.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Fi={init:function(){this.setColour(Ai),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(J.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},vi={init:function(){this.setColour(Ai),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_DELETE_TOOLTIP)}},Yi={init:function(){this.setColour(Ai),this.appendValueInput("DICT2").setCheck("Dict").appendField(J.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(J.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(J.Msg.MIXLY_MID),this.setTooltip(J.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_CLEAR),this.setTooltip(J.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_ITEMS),this.setTooltip(J.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Xi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_VALUES),this.setTooltip(J.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},yi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.MIXLY_LENGTH),this.setTooltip(J.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Ui={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_DELDICT),this.setTooltip(J.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bi={init:function(){this.MODE=[[J.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[J.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(J.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=J.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=J.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==J.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new J.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Gi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.setTooltip(J.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},wi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(J.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ki={init:function(){this.setColour(Ai),this.appendDummyInput("").appendField(new J.FieldLabel(J.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new J.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(J.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hi={init:function(){this.setColour(Ai),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},xi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.MIXLY_TO_JSON),this.setTooltip(J.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi={init:function(){this.setColour(Ai),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(J.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(J.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ki={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ji=210,ji={init:function(){var t=J.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:J.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:J.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:J.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:J.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:J.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:J.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Qi={init:function(){var t=J.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=J.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new J.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},qi={init:function(){var t=[[J.Msg.LOGIC_OPERATION_AND,"AND"],[J.Msg.LOGIC_OPERATION_OR,"OR"],[J.Msg.LOGIC_OPERATION_NOR,"NOR"],[J.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:J.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:J.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:J.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:J.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},zi={init:function(){this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(J.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(J.Msg.LOGIC_NEGATE_TOOLTIP)}},Zi={init:function(){var t=[[J.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[J.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new J.FieldDropdown(t),"BOOL"),this.setTooltip(J.Msg.LOGIC_BOOLEAN_TOOLTIP)}},$i={init:function(){this.setColour(Ji),this.setOutput(!0),this.appendDummyInput().appendField(J.Msg.LOGIC_NULL),this.setTooltip(J.Msg.LOGIC_NULL_TOOLTIP)}},tn={init:function(){this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").appendField(J.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(J.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},en={init:function(){var t=[[J.Msg.TEXT_APPEND_TO,"in"],[J.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new J.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(J.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(J.Msg.IN)}},nn={init:function(){var t=[[J.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[J.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},sn={init:function(){this.setColour(Ji),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},on={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(J.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},un={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG,_=J.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},an={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(J.Msg.MIXPY_TEXT_ENCODE).appendField(new J.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG,_=J.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},rn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:J.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(J.Msg.MICROBIT_PYTHON_TYPE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.HTML_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},dn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},hn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Mn={init:function(){this.setColour(0),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const mn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+J.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+J.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Rn={init:function(){this.setColour(0),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},gn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(J.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+J.Msg.MIXLY_ESP32_SET+{mkdir:J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(J.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},An={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.HTML_FILE,"isfile"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Sn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(J.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(J.Msg.MIXLY_SETUP+J.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(J.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(J.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},fn={};fn.NAME_TYPE=J.PROCEDURE_CATEGORY_NAME,fn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(J.Msg.MIXLY_AIP_ATTR).setAlign(J.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},As={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_FORM_CONTENT).appendField(new J.FieldDropdown([[J.Msg.HTML_TEXT,"text"],[J.Msg.HTML_EMAIL,"email"],[J.Msg.HTML_NUMBER,"number"],[J.Msg.HTML_PASSWORD,"password"],[J.Msg.HTML_CHECKBOX,"checkbox"],[J.Msg.HTML_RADIOBUTTON,"radiobutton"],[J.Msg.HTML_BUTTON,"button"],[J.Msg.HTML_COLOUR,"colour"],[J.Msg.HTML_DATE,"date"],[J.Msg.HTML_LOCALTIME,"local time"],[J.Msg.HTML_FILE,"file"],[J.Msg.HTML_HIDDEN,"hidden"],[J.Msg.HTML_IMAGE,"image"],[J.Msg.HTML_MONTH,"month"],[J.Msg.HTML_RANGE,"range"],[J.Msg.HTML_RESET,"reset"],[J.Msg.HTML_SEARCH,"search"],[J.Msg.HTML_SUBMIT,"submit"],[J.Msg.HTML_TELEPHONENUMBER,"telephone number"],[J.Msg.HTML_TIME,"time"],[J.Msg.HTML_URL,"url"],[J.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(J.Msg.HTML_NAME).appendField(new J.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(J.Msg.HTML_VALUE).appendField(new J.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(J.Msg.MIXLY_AIP_ATTR).setAlign(J.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ls={init:function(){this.setColour(ms),this.appendDummyInput().appendField(new J.FieldTextInput("property"),"KEY").appendField(":").appendField(new J.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(ms),this.appendDummyInput().appendField(new J.FieldTextInput("property"),"KEY").appendField(":").appendField(new J.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ds={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_TEXT).appendField(new J.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fs=160,Ns={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new J.FieldTable(""),"TEXT")}},Ps={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new J.FieldMultilineInput(""),"TEXT")}},Fs={init:function(){this.setColour(fs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new J.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},vs={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ys={init:function(){this.setColour(fs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new J.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},bs={init:function(){this.setColour(fs),this.appendValueInput("VALUE").appendField(J.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Vs={init:function(){this.setColour(fs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(J.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=J.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+r()+"("+t+", "+e+", "+i+")"},J.isNumber(n)&&J.isNumber(s)&&J.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Lu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Su=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Du=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},fu=function(t,e){return["None",e.ORDER_ATOMIC]},Nu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Pu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Fu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},vu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Yu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},bu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Vu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Xu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},yu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Uu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Bu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Gu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},wu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ku=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Hu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},xu=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Wu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ku=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ju=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ju=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Qu=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},qu=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},zu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Zu=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},$u=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},ta=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},ea=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},ia=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),J.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Xa=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ya=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Ua=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Ba=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ga=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},wa=function(t,e){return'"},ka=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Ha=function(){return this.getFieldValue("TEXT")+"\n"},xa=function(t){return t.getFieldValue("TEXT")+"\n"},Wa=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ka=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Ja=function(){return""},ja=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Qa=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},za.scrubNakedValue=function(t){return t+"\n"},za.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},za.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},za.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=J.utils.string.wrap(o,za.COMMENT_WRAP-3),n+=za.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const Za={microbit:{description:"microbit_python",digital:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],pwm:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],analog:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P10","10"]],interrupt:[["P0","0"],["P1","1"],["P2","2"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","Image.HEART"],["HEART_SMALL","Image.HEART_SMALL"],["HAPPY","Image.HAPPY"],["SMILE","Image.SMILE"],["SAD","Image.SAD"],["CONFUSED","Image.CONFUSED"],["ANGRY","Image.ANGRY"],["ASLEEP","Image.ASLEEP"],["SURPRISED","Image.SURPRISED"],["SILLY","Image.SILLY"],["FABULOUS","Image.FABULOUS"],["MEH","Image.MEH"],["YES","Image.YES"],["NO","Image.NO"],["CLOCK12","Image.CLOCK12"],["CLOCK11","Image.CLOCK11"],["CLOCK10","Image.CLOCK10"],["CLOCK9","Image.CLOCK9"],["CLOCK8","Image.CLOCK8"],["CLOCK7","Image.CLOCK7"],["CLOCK6","Image.CLOCK6"],["CLOCK5","Image.CLOCK5"],["CLOCK4","Image.CLOCK4"],["CLOCK3","Image.CLOCK3"],["CLOCK2","Image.CLOCK2"],["CLOCK1","Image.CLOCK1"],["ARROW_N","Image.ARROW_N"],["ARROW_NE","Image.ARROW_NE"],["ARROW_E","Image.ARROW_E"],["ARROW_SE","Image.ARROW_SE"],["ARROW_S","Image.ARROW_S"],["ARROW_SW","Image.ARROW_SW"],["ARROW_W","Image.ARROW_W"],["ARROW_NW","Image.ARROW_NW"],["TRIANGLE","Image.TRIANGLE"],["TRIANGLE_LEFT","Image.TRIANGLE_LEFT"],["CHESSBOARD","Image.CHESSBOARD"],["DIAMOND","Image.DIAMOND"],["DIAMOND_SMALL","Image.DIAMOND_SMALL"],["SQUARE","Image.SQUARE"],["SQUARE_SMALL","Image.SQUARE_SMALL"],["RABBIT","Image.RABBIT"],["COW","Image.COW"],["MUSIC_CROTCHET","Image.MUSIC_CROTCHET"],["MUSIC_QUAVER","Image.MUSIC_QUAVER"],["MUSIC_QUAVERS","Image.MUSIC_QUAVERS"],["PITCHFORK","Image.PITCHFORK"],["XMAS","Image.XMAS"],["PACMAN","Image.PACMAN"],["TARGET","Image.TARGET"],["TSHIRT","Image.TSHIRT"],["ROLLERSKATE","Image.ROLLERSKATE"],["DUCK","Image.DUCK"],["HOUSE","Image.HOUSE"],["TORTOISE","Image.TORTOISE"],["BUTTERFLY","Image.BUTTERFLY"],["STICKFIGURE","Image.STICKFIGURE"],["GHOST","Image.GHOST"],["SWORD","Image.SWORD"],["GIRAFFE","Image.GIRAFFE"],["SKULL","Image.SKULL"],["UMBRELLA","Image.UMBRELLA"],["SNAKE","Image.SNAKE"],["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],imglist:[["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["P0","0"],["P1","1"],["P2","2"],["P8","8"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]]}};Za["Mithon CC"]=Za.microbit;const $a=Za,tr=100,er={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",message0:J.Msg.MIXLY_MICROBIT_Play_built_in_melody,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Play_built_in_melody1)}},ir={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",tooltip:"Play one of the built-in melodies. Indicate if you need to wait before continuing or continuously loop the melody.",message0:J.Msg.MIXLY_MICROBIT_Play_built_in_melody_easy,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"}]})}},nr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_TONE).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MIXLY_FREQUENCY),this.appendValueInput("duration").setCheck(Number).appendField(J.Msg.MIXLY_DURATION),this.appendDummyInput("").appendField(J.Msg.MIXLY_MILLIS).appendField(J.Msg.MIXLY_MICROBIT_WAIT),this.appendDummyInput("").appendField(new J.FieldCheckbox(!0),"wait"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},sr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_TONE).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},or={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",message0:J.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Play_notes1)}},_r={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",tooltip:"Play a list of notes expressed in the special music language. Indicate if you need to wait before continuing or continuously loop the melody.",message0:J.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{type:"input_dummy"},{type:"input_dummy"}]})}},ur={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.reset",message0:J.Msg.MIXLY_MICROBIT_Reset_music}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Reset_music)}},ar={init:function(){this.setColour(tr),this.appendValueInput("PIN").appendField(J.Msg.MIXLY_NOTONE).appendField(J.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_NOTONE)}},rr={init:function(){this.jsonInit({colour:tr,output:"Array",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.get_tempo",message0:J.Msg.MIXLY_MICROBIT_Get_current_tempo}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Get_current_tempo)}},pr={init:function(){this.setColour(tr),this.appendValueInput("TICKS").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(J.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(J.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_SET_TEMPO1)}},lr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,"say"],[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,"sing"],[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE,"pronounce"]]),"MODE"),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_pitch),this.appendValueInput("speed").setCheck(Number).appendField(J.Msg.MIXLY_SPEED),this.appendValueInput("mouth").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_mouth),this.appendValueInput("throat").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_throat),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH,n=J.Msg.MIXLY_MICROBIT_TYPE_STRING;return i+{say:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,sing:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,pronounce:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE}[e]+n}))}},Ir={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},dr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},hr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MICROBIT_SPEECH_translation),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.MICROBIT_SPEECH_translation)}},Mr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_SERVO).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERVO_MOVE)}},mr={init:function(){this.appendValueInput("speed").setCheck(null).appendField(J.Msg.MIXLY_MOTOR).appendField(new J.FieldDropdown([["M1","1"],["M2","2"],["M3","3"],["M4","4"]]),"Motor").appendField(J.Msg.MIXLY_SPEED),this.appendDummyInput().appendField(new J.FieldDropdown([["Forward","1*"],["Reverse","-1*"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(tr),this.setTooltip(""),this.setHelpUrl("")}},cr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_RGB_PIN_COUNT)}},Or={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(J.Msg.MIXLY_RGB_NUM_R_G_B)}},Er={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").setAlign(J.inputs.Align.RIGHT).appendField(new J.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendDummyInput().appendField(J.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(J.Msg.MIXLY_ESP32_MUSIC_WRI)}},gr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_SETUP+" "+J.Msg.QJ00X_MP3),this.appendValueInput("RX").setAlign(J.inputs.Align.RIGHT).appendField("RX#"),this.appendValueInput("TX").setAlign(J.inputs.Align.RIGHT).appendField("TX#"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Cr=[[J.Msg.MIXLY_MP3_PLAY,"play"],[J.Msg.MIXLY_MP3_PAUSE,"pause"],[J.Msg.MIXLY_MP3_NEXT,"next_track"],[J.Msg.MIXLY_MP3_PREV,"prev_track"],[J.Msg.MIXLY_MP3_VOL_UP,"inc_vol"],[J.Msg.MIXLY_MP3_VOL_DOWN,"dec_vol"]];const Ar={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Cr),"CONTROL_TYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Lr=[[J.Msg.MIXLY_MP3_LOOP_ALL,"0"],[J.Msg.MIXLY_MP3_LOOP_FOLDER,"1"],[J.Msg.MIXLY_MP3_LOOP_ONE,"2"],[J.Msg.MIXLY_MP3_LOOP_RAM,"3"]];const Sr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_LOOP_MODE).appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Lr),"LOOP_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Dr=[[J.Msg.MIXLY_MP3_EQ_NORMAL,"0"],[J.Msg.MIXLY_MP3_EQ_POP,"1"],[J.Msg.MIXLY_MP3_EQ_ROCK,"2"],[J.Msg.MIXLY_MP3_EQ_JAZZ,"3"],[J.Msg.MIXLY_MP3_EQ_CLASSIC,"4"],[J.Msg.MIXLY_MP3_EQ_BASS,"5"]];const fr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_EQ_MODE).appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Dr),"EQ_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Nr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_VOL),this.appendValueInput("vol",Number).appendField(J.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Pr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Fr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendValueInput("FOLDER",Number).appendField(J.Msg.DFPLAYER_MINI_FOLDER).setCheck(Number),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},vr=140,Yr={init:function(){this.setColour(225),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"on"],[J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"off"],[J.Msg.HTML_RESET,"reset"]]),"type").appendField(J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type"),i=J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI;return{on:J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,off:J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,reset:J.Blockly.Msg.HTML_RESET}[e]+i}))}},br={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.on",tooltip:"Turn on the radio. This needs to be explicitly called since the radio draws power and takes up memory that you may otherwise need.",message0:J.Msg.MIXLY_MICROBIT_Switch_on_radio})}},Vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.off",tooltip:"Turn off the radio, thus saving power and memory.",message0:J.Msg.MIXLY_MICROBIT_Switch_off_radio})}},Xr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.config",tooltip:J.Msg.MIXLY_MICROBIT_Configure_radio1,message0:J.Msg.MIXLY_MICROBIT_Configure_radio,args0:[{min:4,value:32,type:"input_value",max:251,name:"length"},{type:"input_dummy"},{min:1,value:3,type:"input_value",max:32,name:"queue"},{type:"input_dummy"},{min:0,value:7,type:"input_value",max:100,name:"channel"},{type:"input_dummy"},{name:"power",type:"input_value"},{type:"input_dummy"},{name:"address",type:"input_value"},{type:"input_dummy"},{name:"group",type:"input_value"},{type:"input_dummy"},{name:"data_rate",type:"input_value"}]})}},yr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.reset",tooltip:"Reset the radio to default settings.",message0:J.Msg.MIXLY_MICROBIT_Reset_radio})}},Ur={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.send",tooltip:"Broadcast a text message.",message0:J.Msg.MIXLY_MICROBIT_Send_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},Br={init:function(){this.setColour(225),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_RADIO_SEND),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_MSG,"send"],[J.Msg.MIXLY_MICROBIT_MSG_BYTE,"send_bytes"]]),"type"),this.appendValueInput("data"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_Send_message1)}},Gr={init:function(){this.jsonInit({colour:225,output:"String",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.receive",tooltip:J.Msg.MIXLY_MICROBIT_Receive_message,message0:J.Msg.MIXLY_MICROBIT_Receive_message})}},wr={init:function(){this.setColour(225),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_Receive_message),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_MSG,"receive"],[J.Msg.MIXLY_MICROBIT_MSG_BYTE,"receive_bytes"],[J.Msg.MIXLY_MICROBIT_MSG_FULL,"receive_full"]]),"type"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_Receive_message)}},kr={init:function(){this.setColour(vr),this.appendValueInput("RX",Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_SETUP).appendField("sda").setCheck(Number).setAlign(J.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("scl").setCheck(Number).setAlign(J.inputs.Align.RIGHT),this.appendValueInput("freq").setCheck(Number).appendField("频率").setAlign(J.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(vr),this.appendValueInput("address").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_READ_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.LANG_MATH_BYTE),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new J.FieldCheckbox(!1),"is_repeated"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_I2C_READ)}},xr={init:function(){this.setColour(vr),this.appendValueInput("address").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_WRITE_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new J.FieldCheckbox(!1),"is_repeated"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_I2C_WRITE)}},Wr={init:function(){this.jsonInit({colour:vr,nextStatement:null,previousStatement:null,message0:J.Msg.MIXLY_MICROBIT_SPI_INIT,args0:[{value:1e6,type:"field_number",name:"freq"},{type:"input_dummy"},{value:8,type:"field_number",name:"bits"},{type:"input_dummy"},{value:0,type:"field_number",name:"mode"},{type:"input_dummy"},{name:"mosi",options:j.Profile.default.digital,type:"field_dropdown"},{name:"miso",options:j.Profile.default.digital,type:"field_dropdown"},{name:"sck",options:j.Profile.default.digital,type:"field_dropdown"}]}),this.setFieldValue("15","mosi"),this.setFieldValue("14","miso"),this.setFieldValue("13","sck")}},Kr={init:function(){this.setColour(vr),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_SPI_WRITE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_SPI_WRITE)}},Jr=180,jr={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:J.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Clear_display)}},Qr={init:function(){this.setColour(Jr),this.appendValueInput("x").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_GET).appendField(J.Msg.MIXLY_BRIGHTNESS).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_BRIGHTNESS1)}},qr={init:function(){this.setColour(Jr),this.appendValueInput("x").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SET_BRIGHTNESS).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("brightness").setCheck(Number).appendField(J.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_BRIGHTNESS2)}},zr={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck([String,"microbit_image"]).appendField(J.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING)}},Zr={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("delay").setCheck(null).appendField(J.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(J.Msg.MIXLY_MILLIS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tp={init:function(){this.setColour(Jr),this.appendValueInput("PIN",String).setCheck("microbit_image").appendField(J.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.OLED_BITMAP)}},ep={init:function(){this.jsonInit({colour:Jr,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:J.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}]})}},ip={init:function(){this.jsonInit({colour:Jr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:J.Msg.MIXLY_MICROBIT_Animate_images_or_string,args0:[{check:[String,"List"],type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+J.Msg.MIXLY_MICROBIT_Animate_images1)}},np={init:function(){this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.jsonInit({colour:Jr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:J.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING)}},sp={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:J.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},op={init:function(){this.setColour(Jr),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[J.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(J.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=J.Msg.MIXLY_MICROBIT_monitor;return{on:J.Msg.MIXLY_MICROBIT_Turn_on_display,off:J.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},_p={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:J.Msg.MIXLY_MICROBIT_Turn_off_display})}},up={init:function(){this.jsonInit({colour:Jr,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:J.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Display_is_on1)}},ap={init:function(){this.jsonInit({colour:Jr,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}],output:["microbit_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:J.Msg.MIXLY_MICROBIT_Built_in_image1,message0:J.Msg.MIXLY_MICROBIT_Built_in_image})}},rp={init:function(){this.jsonInit({colour:Jr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.copy",message0:J.Msg.MIXLY_MICROBIT_Copy_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Copy_image1)}},pp={init:function(){this.jsonInit({colour:Jr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.invert",message0:J.Msg.MIXLY_MICROBIT_Invert_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Invert_image1)}},lp={init:function(){this.jsonInit({colour:Jr,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:J.Msg.MIXLY_MICROBIT_Create_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Create_image1)}},Ip={init:function(){var t=[[J.Msg.MIXLY_UP,"up"],[J.Msg.MIXLY_DOWN,"down"],[J.Msg.MIXLY_LEFT,"left"],[J.Msg.MIXLY_RIGHT,"right"]];this.setColour(Jr),this.setOutput(!0,"microbit_image"),this.setInputsInline(!0),this.appendValueInput("img").appendField(J.Msg.DISPLAY_IMAGE_LET).setCheck(["microbit_image","List",String]),this.appendDummyInput("").appendField(J.Msg.DISPLAY_IMAGE_LET2).appendField(new J.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(J.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(J.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=J.Msg.DISPLAY_IMAGE_LET,n=J.Msg.DISPLAY_IMAGE_LET2,s=J.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:J.Msg.MIXLY_UP,down:J.Msg.MIXLY_DOWN,left:J.Msg.MIXLY_LEFT,right:J.Msg.MIXLY_RIGHT}[t]+s}))}},Tp={init:function(){var t=[[J.Msg.MICROBIT_DISPLAY_UNION,"+"],[J.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(Jr),this.setOutput(!0,"microbit_image"),this.appendValueInput("A").appendField(J.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":J.Msg.MIXLY_MICROBIT_image_add,"-":J.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},dp={init:function(){this.setColour(Jr),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(J.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},hp={init:function(){this.setColour(Jr),this.appendValueInput("device").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_SETUP).appendField(J.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(J.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_SETUP+J.Msg.MIXLY_DF_LCD+J.Msg.MIXLY_LCD_ADDRESS)}},Mp={init:function(){this.setColour(Jr),this.appendValueInput("row",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(J.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},mp={init:function(){this.setColour(Jr),this.appendDummyInput().appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new J.FieldDropdown([[J.Msg.MIXLY_ON,"on()"],[J.Msg.MIXLY_OFF,"off()"],[J.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[J.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(False)"],[J.Msg.MIXLY_LCD_BACKLIGHT,"backlight(True)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return J.Msg.LISTS_SET_INDEX_SET+J.Msg.MIXLY_DF_LCD+{"on()":J.Msg.MIXLY_ON,"off()":J.Msg.MIXLY_OFF,"clear()":J.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":J.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":J.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},cp={init:function(){this.appendDummyInput().appendField(J.Msg.MIXLY_DF_LCD+" OLED "+J.Msg.OLEDDISPLAY),this.appendValueInput("Text_line1","String").setAlign(J.inputs.Align.RIGHT).appendField("(128*64) "+J.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Jr),this.setTooltip(J.Msg.MIXLY_DF_LCD+J.Msg.OLEDDISPLAY+J.Msg.MIXLY_MICROBIT_TYPE_STRING)}},Op={init:function(){var t=[[J.Msg.MIXLY_HEIGHT,"height"],[J.Msg.MIXLY_WIDTH,"width"]];this.setColour(Jr),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+J.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("microbit_image"),this.appendDummyInput("").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+J.Msg.MIXLY_MICROBIT_IMAGE+{height:J.Msg.MIXLY_HEIGHT,width:J.Msg.MIXLY_WIDTH}[t]}))}},Ep={init:function(){this.setColour(Jr),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[J.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:J.Msg.MIXLY_LCD_STAT_CLEAR,1:J.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return J.Msg.MIXLY_DF_LCD+i[e]}))}},Rp="#777777",gp={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField("from ").appendField(new J.FieldTextInput("microbit"),"path").appendField(" import ").appendField(new J.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cp={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField("import ").appendField(new J.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ap={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField(new J.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e0)var u="rgb_show.mixly_rgb_show("+(i-1)+", "+s+", "+o+", "+_+")\n";else u="rgb_show.mixly_rgb_show_all("+s+", "+o+", "+_+")\n";return u},JT=function(t,e){var i=this.getFieldValue("LED");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel",e.definitions_.import_rgb_show="import rgb_show",i>0)var n="rgb_show.mixly_rgb_show("+(i-1)+", 0, 0, 0)\n";else n="rgb_show.mixly_rgb_show_all(0, 0, 0)\n";return n},jT=function(t,e){var i=e.valueToCode(this,"_LED_",e.ORDER_ATOMIC),n=e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC),s=e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC),o=e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel",e.definitions_.import_rgb_show="import rgb_show","rgb_show.mixly_rgb_show("+i+", "+n+", "+s+", "+o+")\n"},QT=function(t,e){var i=this.getFieldValue("NUMBER"),n=e.valueToCode(this,"SPEED",e.ORDER_ATOMIC),s=this.getFieldValue("DIRECTION");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_motor_control="import motor_control",0==i)var o="motor_control.motor1("+n+", "+s+")\nmotor_control.motor2("+n+", "+s+")\nmotor_control.motor3("+n+", "+s+")\n";else if(1==i)o="motor_control.motor1("+n+", "+s+")\n";else if(2==i)o="motor_control.motor2("+n+", "+s+")\n";else if(3==i)o="motor_control.motor3("+n+", "+s+")\n";return o},qT=function(t,e){var i=this.getFieldValue("NUMBER");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_motor_control="import motor_control",0==i)var n="motor_control.motor1(0)\nmotor_control.motor2(0)\nmotor_control.motor3(0)\n";else if(1==i)n="motor_control.motor1(0)\n";else if(2==i)n="motor_control.motor2(0)\n";else if(3==i)n="motor_control.motor3(0)\n";return n},zT=function(t,e){return["pin"+this.getFieldValue("NUMBER")+".read_analog()",e.ORDER_ATOMIC]},ZT=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"btn",e.ORDER_ATOMIC);e.setups_["on_"+i]="def on_"+i+"():\n while True:\n if "+i+".was_pressed():\n yield callback_"+i+"()\n else:\n yield\n\nfunc_"+i+" = on_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_"+i+")\n","def callback_"+i+"():\n"+n},$T=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=this.getFieldValue("gesture");e.setups_["on_"+i]="def on_gesture_"+i+'():\n while True:\n if accelerometer.is_gesture("'+i+'"):\n yield callback_gesture_'+i+"()\n else:\n yield\n\nfunc_gesture_"+i+" = on_gesture_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_gesture_"+i+")\n","def callback_gesture_"+i+"():\n"+n},td=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=this.getFieldValue("near");e.setups_["on_"+i]="def on_near_"+i+"():\n while True:\n if not pin"+i+".read_digital():\n yield callback_near_"+i+"()\n else:\n yield\n\nfunc_near_"+i+" = on_near_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_near_"+i+")\n","def callback_near_"+i+"():\n"+n},ed=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"TIMES",e.ORDER_ATOMIC),n=e.statementToCode(t,"DO");return"for _my_variable in range("+i+"):\n"+(n=e.addLoopTrap(n,t.id)||e.PASS)},id=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},nd=id,sd=id,od=id,_d=id,ud=id,ad=id,rd=id,pd=id,ld=id,Id=id,Td=id,dd=id,hd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".is_pressed()",e.ORDER_ATOMIC]},Md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".was_pressed()",e.ORDER_ATOMIC]},md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".get_presses()",e.ORDER_ATOMIC]},cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['"'+this.getFieldValue("gesture")+'"',e.ORDER_ATOMIC]},Od=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",'if accelerometer.is_gesture("'+this.getFieldValue("gesture")+'"):\n'+(e.statementToCode(this,"DO")||e.PASS)},Ed=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.is_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},Rd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.was_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",'if accelerometer.was_gesture("'+this.getFieldValue("gesture")+'"):\n'+(e.statementToCode(this,"DO")||e.PASS)},Cd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i,n=this.getFieldValue("GES");return"all"==n?i="accelerometer.get_gestures()":"current"==n&&(i="accelerometer.current_gesture()"),[i,e.ORDER_ATOMIC]},Ad=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.current_gesture()",e.ORDER_ATOMIC]},Ld=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.get_"+this.getFieldValue("key")+"()",e.ORDER_ATOMIC]},Sd=function(){return"input.setAccelerometerRange("+this.getFieldValue("key")+")\n"},Dd=function(t,e){return["input.lightLevel()",e.ORDER_ATOMIC]},fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.calibrate()\n"},Nd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.is_calibrated()",e.ORDER_ATOMIC]},Pd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.heading()",e.ORDER_ATOMIC]},Fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["temperature()",e.ORDER_ATOMIC]},vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass."+this.getFieldValue("compass")+"()",e.ORDER_ATOMIC]},Yd=function(t,e){return["input.rotation("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},bd=function(t,e){return["input.magneticForce("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},Vd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="import ultrasonic",["ultrasonic.distance_cm(t_pin=pin"+i+", e_pin=pin"+n+")",e.ORDER_ATOMIC]},Xd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.setups_.class_hrsc04_="class HCSR04:\n def __init__(self, tpin=pin"+i+", epin=pin"+n+', spin=pin13):\n self.trigger_pin = tpin\n self.echo_pin = epin\n self.sclk_pin = spin\n\n def distance_mm(self):\n spi.init(baudrate=125000, sclk=self.sclk_pin,\n mosi=self.trigger_pin, miso=self.echo_pin)\n pre = 0\n post = 0\n k = -1\n length = 500\n resp = bytearray(length)\n resp[0] = 0xFF\n spi.write_readinto(resp, resp)\n # find first non zero value\n try:\n i, value = next((ind, v) for ind, v in enumerate(resp) if v)\n except StopIteration:\n i = -1\n if i > 0:\n pre = bin(value).count("1")\n # find first non full high value afterwards\n try:\n k, value = next((ind, v)\n for ind, v in enumerate(resp[i:length - 2]) if resp[i + ind + 1] == 0)\n post = bin(value).count("1") if k else 0\n k = k + i\n except StopIteration:\n i = -1\n dist= -1 if i < 0 else round((pre + (k - i) * 8. + post) * 8 * 0.172)\n return dist\n\n def distance_cm(self):\n return self.distance_mm() / 10.0\n\nsonar=HCSR04()\n\n',["sonar.distance_cm()",e.ORDER_ATOMIC]},yd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *"},Ud=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *";var i=this.getFieldValue("TIME_TYPE");switch(i){case"Year":case"Month":case"Day":case"Hour":case"Minute":case"Second":case"Week":return["ds."+i+"()",e.ORDER_ASSIGNMENT];case"Mix1":return["ds.get_date()",e.ORDER_ASSIGNMENT];case"Mix2":return["ds.get_time()",e.ORDER_ASSIGNMENT]}},Bd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_time("+e.valueToCode(this,"hour",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"minute",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"second",e.ORDER_ASSIGNMENT)+")\n"},Gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_date("+e.valueToCode(this,"year",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"month",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"day",e.ORDER_ASSIGNMENT)+")\n"},wd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.clear_calibration()\n"},kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.read_light_level()",e.ORDER_ATOMIC]},Hd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="from ultrasonic import *","sonar = HCSR04(tpin=pin"+i+", epin=pin"+n+")\n"},xd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_TCS="from TCS import *",["tcs.getRawRGBData("+this.getFieldValue("TCS34725_COLOR")+")",e.ORDER_ATOMIC]},Wd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+"))\n"},Kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+")+'\\r\\n')\n"},Jd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str(hex("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||"0")+")) + '\\r\\n')\n"},jd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"char_marker",e.ORDER_ATOMIC)||";",n=e.statementToCode(this,"DO");e.definitions_["func_serial_receive_data_event_"+i.charCodeAt(1)]="serial.onDataReceived("+i+", () => {\n"+n+"}\n"},Qd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.any()",e.ORDER_ATOMIC]},qd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.read()",e.ORDER_ATOMIC]},zd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.readline()",e.ORDER_ATOMIC]},Zd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["serial.readUntil("+this.getFieldValue("char_marker")+")",e.ORDER_ATOMIC]},$d=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"RX",e.ORDER_ATOMIC),n=e.valueToCode(this,"TX",e.ORDER_ATOMIC);return isNaN(parseInt(i))||(i="pin"+i),isNaN(parseInt(n))||(n="pin"+n),"uart.init(rx="+i+", tx="+n+", baudrate="+this.getFieldValue("baudrate")+")\n"},th=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.init(baudrate="+this.getFieldValue("baudrate")+")\n"},eh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},ih=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},nh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},sh=function(t,e){return"control.inBackground(() => {\n"+e.statementToCode(this,"do")+"})\n"},oh=function(){return"control.reset()\n"},_h=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||j.Profile.default.serial)+")\n"},uh=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||j.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||j.Profile.default.serial)+")\n"},ah=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||j.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||j.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},rh=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},ph=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},lh=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Ih=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Th=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},dh=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},hh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Mh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},mh=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["running_time()",e.ORDER_ATOMIC]},ch=function(){return"while True:\n pass\n"},Oh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","reset()\n"},Eh=function(t,e){return e.definitions_.import_os="import os",["os.uname()",e.ORDER_ATOMIC]};Object.assign(J.Variables,q),Object.assign(J.Procedures,Nn),J.Python=za,J.generator=za,j.Profile.default={},Object.assign(j.Profile,$a),Object.assign(j.Profile.default,$a.microbit),Object.assign(J.Blocks,e,i,n,s,o,_,u,a,r,p,l,I,T,D,f,N,N,P,F,v,Y,b,V,X),Object.assign(J.Python.forBlock,d,h,M,m,c,O,E,R,g,C,A,L,S,y,U,B,B,G,w,k,H,x,W,K)})(); \ No newline at end of file +class z{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(J.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(J.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(J.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(J.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Mt={init:function(){this.setColour(pt),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.PYTHON_RANGE).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},mt={init:function(){this.setColour(pt),this.appendValueInput("LIST").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(J.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return J.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ct={init:function(){this.setColour(pt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(J.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new J.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(J.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:J.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:J.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Ot={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(J.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Et={init:function(){this.setColour(pt);var t=new J.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:J.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:J.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Rt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new J.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return J.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},gt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new J.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return J.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};ct.OPERATORS=[[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Et.OPERATORS=[[J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[J.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Ct={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(J.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},At={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Lt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(J.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},St={init:function(){this.setColour(pt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Dt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},ft={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(J.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Nt={init:function(){this.jsonInit({message0:J.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:pt,tooltip:J.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:J.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Pt={init:function(){this.setColour(pt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(J.Msg.MIXLY_STAT),this.setOutput(!0)}},Ft={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},vt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Yt={init:function(){this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT+J.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(J.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new J.FieldDropdown([[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[J.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(pt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},bt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Xt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},yt={init:function(){this.setColour(pt),this.appendDummyInput().appendField(J.Msg.MIXLY_GET+J.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ut={init:function(){this.setColour(pt),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(J.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Bt=230;J.FieldTextInput.math_number_validator=function(t){return String(t)},J.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Gt={init:function(){this.setColour(Bt),this.appendDummyInput().appendField(new J.FieldTextInput("0",J.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(J.Msg.MATH_NUMBER_TOOLTIP)}},wt={init:function(){this.setColour(Bt);this.appendDummyInput("").appendField(J.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new J.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},kt={init:function(){this.setColour(Bt);this.appendDummyInput("").appendField(J.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new J.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:J.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ht={init:function(){this.setColour(Bt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:J.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:J.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:J.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:J.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:J.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},xt={init:function(){this.setColour(Bt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:J.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:J.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:J.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:J.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:J.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:J.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Wt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new J.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Kt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new J.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:J.Msg.MATH_TRIG_TOOLTIP_SIN,COS:J.Msg.MATH_TRIG_TOOLTIP_COS,TAN:J.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:J.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:J.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:J.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:J.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Jt={init:function(){var t=[[J.Msg.MATH_BIN,"bin"],[J.Msg.MATH_OCT,"oct"],[J.Msg.MATH_HEX,"hex"]];this.setColour(Bt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new J.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:J.Msg.MATH_DEC_TOOLTIP_BIN,oct:J.Msg.MATH_DEC_TOOLTIP_OCT,hex:J.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},jt={init:function(){var t=[[J.Msg.LANG_MATH_TO_ROUND,"round"],[J.Msg.LANG_MATH_TO_CEIL,"ceil"],[J.Msg.LANG_MATH_TO_FLOOR,"floor"],[J.Msg.MATH_ABS,"fabs"],[J.Msg.MATH_SQRT,"sqrt"]];this.setColour(Bt),this.appendValueInput("A").setCheck(Number).appendField(new J.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:J.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:J.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:J.Msg.MATH_SINGLE_TOOLTIP_SQ,round:J.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:J.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:J.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Qt={init:function(){var t=[[J.Msg.MIXLY_MAX,"max"],[J.Msg.MIXLY_MIN,"min"]];this.setColour(Bt),this.appendValueInput("A").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(new J.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(J.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:J.Msg.MIXLY_TOOLTIP_MATH_MAX,min:J.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},qt={init:function(){var t=[[J.Msg.MATH_TWO,"two"],[J.Msg.MATH_EIGHT,"eight"],[J.Msg.MATH_TEN,"ten"],[J.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Bt),this.appendDummyInput("").appendField(J.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new J.FieldDropdown(t),"OP").appendField(J.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(J.Msg.MATH_ZHW).appendField(new J.FieldDropdown(t),"OP2").appendField(J.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:J.Msg.MATH_Before_two,eight:J.Msg.MATH_Before_eight,ten:J.Msg.MATH_Before_ten,sixteen:J.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:J.Msg.MATH_Behind_two,eight:J.Msg.MATH_Behind_eight,ten:J.Msg.MATH_Behind_ten,sixteen:J.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},zt={init:function(){var t=[[J.Msg.LANG_MATH_INT,"int"],[J.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Bt),this.setOutput(!0,Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_RANDOM).appendField(new J.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(J.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:J.Msg.LANG_MATH_INT,float:J.Msg.LANG_MATH_FLOAT_RANDOM};return J.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Zt={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(J.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(J.Msg.MATH_CONSTRAIN_TOOLTIP)}},$t={init:function(){this.setColour(Bt),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(J.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(J.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_MATH_MAP)}},te={init:function(){this.setColour(Bt),this.appendDummyInput().appendField(new J.FieldTextInput("0",J.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(J.Msg.MATH_NUMBER_TOOLTIP)}},ee={init:function(){this.setColour(Bt),this.appendValueInput("NUM").setCheck(Number).appendField(J.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},ie={init:function(){this.setColour(Bt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(J.Msg.MATH_ROUND).appendField(J.Msg.TEXT_KEEP),this.appendDummyInput().appendField(J.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(J.Msg.MATH_ROUND_NEW_TOOLTIP)}},ne={init:function(){var t=[[J.Msg.MIXLY_TO_INT,"int"],[J.Msg.MIXLY_TO_FLOAT,"float"],[J.Msg.MIXLY_TO_BITES,"b"],[J.Msg.LANG_MATH_BYTE+J.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Bt),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:J.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:J.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:J.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},se={init:function(){var t=[[J.Msg.MIXLY_TO_INT,"int"],[J.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Bt),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:J.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:J.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},oe=$t,_e={init:function(){this.setColour(Bt),this.appendValueInput("VAR").appendField(J.Msg.LANG_MATH_BYTE+J.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},ue={init:function(){this.setColour(Bt),this.itemCount_=1,this.setMutator(new J.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(J.Msg.MIXLY_PRODUCT+J.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(J.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(J.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const le={init:function(){this.setColour(ae),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new J.FieldTextInput("",J.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(J.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new J.FieldImage(e,7,12,'"')}},Ie={init:function(){this.setColour(ae),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(J.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Te={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(Number).appendField(J.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},de={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},he={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Me={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},me={init:function(){this.WHERE_OPTIONS=[[J.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[J.Msg.TEXT_GET_INDEX_RANDOM+1+J.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(J.Msg.LISTS_GET_INDEX_GET,"MODE"),J.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(J.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=J.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+J.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",J.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:J.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:J.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:J.Msg.TEXT_GET_INDEX_RANDOM};return J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+J.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==J.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),J.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(J.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new J.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),J.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},ce={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(J.Msg.LISTS_GET_INDEX_GET+" "+J.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(J.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(J.Msg.PROCEDURES_DEFRETURN_RETURN+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.LISTS_GET_INDEX_FROM_START+"n"+J.Msg.TEXT_CHARAT2)}},Oe={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(J.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(J.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ee={init:function(){this.WHERE_OPTIONS_1=[[J.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[J.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[J.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[J.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[J.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(J.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==J.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==J.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),J.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(J.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new J.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Re={init:function(){this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(J.Msg.LISTS_GET_INDEX_GET+" "+J.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(J.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(J.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(J.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ge={init:function(){var t=[[J.Msg.MIXLY_EQUALS,"==="],[J.Msg.MIXLY_STARTSWITH,"startswith"],[J.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ae),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new J.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ce={init:function(){this.setColour(ae),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(J.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_COMPARETO_HELP)}},Ae={init:function(){var t=[[J.Msg.TEXT_UPPER,"upper"],[J.Msg.TEXT_TITLE,"title"],[J.Msg.TEXT_CAPITALIZE,"capitalize"],[J.Msg.TEXT_SWAPCASE,"swapcase"],[J.Msg.TEXT_LOWER,"lower"]];this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new J.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:J.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:J.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:J.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:J.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:J.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Le={init:function(){var t=[[J.Msg.TEXT_LJUST,"ljust"],[J.Msg.TEXT_CENTER,"center"],[J.Msg.TEXT_RJUST,"rjust"]];this.setColour(ae),this.appendValueInput("VAR").appendField(new J.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(J.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(J.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Se={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(J.Msg.MIXLY_MID+J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(J.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},De={init:function(){this.setColour(ae),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},fe={init:function(){this.setColour(ae),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(J.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(J.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ne={init:function(){this.setColour(ae),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(J.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(J.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Pe={init:function(){var t=[[J.Msg.TEXT_TRIM_BOTH,"strip"],[J.Msg.TEXT_TRIM_LEFT,"lstrip"],[J.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ae),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(J.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new J.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(J.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:J.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:J.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:J.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Fe={init:function(){this.setColour(ae),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new J.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new J.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Si={init:function(){this.setColour(Ai),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(J.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Di={init:function(){this.setColour(Ai),this.appendDummyInput().appendField(J.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},fi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_KEYS),this.setTooltip(J.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ni={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(J.Msg.DICTS_GET_TOOLTIP)}},Pi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(J.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(J.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Fi={init:function(){this.setColour(Ai),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(J.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},vi={init:function(){this.setColour(Ai),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(J.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_DELETE_TOOLTIP)}},Yi={init:function(){this.setColour(Ai),this.appendValueInput("DICT2").setCheck("Dict").appendField(J.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(J.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(J.Msg.MIXLY_MID),this.setTooltip(J.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_CLEAR),this.setTooltip(J.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_ITEMS),this.setTooltip(J.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Xi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_VALUES),this.setTooltip(J.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},yi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.MIXLY_LENGTH),this.setTooltip(J.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Ui={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.DICT_DELDICT),this.setTooltip(J.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bi={init:function(){this.MODE=[[J.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[J.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(J.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(J.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=J.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=J.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==J.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new J.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Gi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(J.Msg.DICTS_ADD_VALUE),this.setTooltip(J.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},wi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(J.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(J.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ki={init:function(){this.setColour(Ai),this.appendDummyInput("").appendField(new J.FieldLabel(J.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new J.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(J.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hi={init:function(){this.setColour(Ai),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},xi={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(J.Msg.MIXLY_TO_JSON),this.setTooltip(J.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi={init:function(){this.setColour(Ai),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(J.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(J.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ki={init:function(){this.setColour(Ai),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ji=210,ji={init:function(){var t=J.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:J.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:J.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:J.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:J.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:J.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:J.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Qi={init:function(){var t=J.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=J.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new J.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},qi={init:function(){var t=[[J.Msg.LOGIC_OPERATION_AND,"AND"],[J.Msg.LOGIC_OPERATION_OR,"OR"],[J.Msg.LOGIC_OPERATION_NOR,"NOR"],[J.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:J.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:J.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:J.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:J.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},zi={init:function(){this.setColour(Ji),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(J.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(J.Msg.LOGIC_NEGATE_TOOLTIP)}},Zi={init:function(){var t=[[J.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[J.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Ji),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new J.FieldDropdown(t),"BOOL"),this.setTooltip(J.Msg.LOGIC_BOOLEAN_TOOLTIP)}},$i={init:function(){this.setColour(Ji),this.setOutput(!0),this.appendDummyInput().appendField(J.Msg.LOGIC_NULL),this.setTooltip(J.Msg.LOGIC_NULL_TOOLTIP)}},tn={init:function(){this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").appendField(J.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(J.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},en={init:function(){var t=[[J.Msg.TEXT_APPEND_TO,"in"],[J.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new J.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(J.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(J.Msg.IN)}},nn={init:function(){var t=[[J.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[J.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Ji),this.appendValueInput("A"),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},sn={init:function(){this.setColour(Ji),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(J.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},on={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(J.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){J.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},un={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG,_=J.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},an={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(J.Msg.MIXPY_TEXT_ENCODE).appendField(new J.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_USE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=J.Msg.MIXLY_BELONG,_=J.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:J.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:J.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:J.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},rn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:J.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:J.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(J.Msg.MICROBIT_PYTHON_TYPE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.HTML_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},dn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},hn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Mn={init:function(){this.setColour(0),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const mn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+J.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+J.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:J.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Rn={init:function(){this.setColour(0),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},gn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(J.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+J.Msg.MIXLY_ESP32_SET+{mkdir:J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(J.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},An={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(J.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.HTML_FILE,"isfile"],[J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+J.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:J.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Sn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(J.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(J.Msg.MIXLY_SETUP+J.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(J.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(J.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(J.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},fn={};fn.NAME_TYPE=J.PROCEDURE_CATEGORY_NAME,fn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(J.Msg.MIXLY_AIP_ATTR).setAlign(J.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},As={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_FORM_CONTENT).appendField(new J.FieldDropdown([[J.Msg.HTML_TEXT,"text"],[J.Msg.HTML_EMAIL,"email"],[J.Msg.HTML_NUMBER,"number"],[J.Msg.HTML_PASSWORD,"password"],[J.Msg.HTML_CHECKBOX,"checkbox"],[J.Msg.HTML_RADIOBUTTON,"radiobutton"],[J.Msg.HTML_BUTTON,"button"],[J.Msg.HTML_COLOUR,"colour"],[J.Msg.HTML_DATE,"date"],[J.Msg.HTML_LOCALTIME,"local time"],[J.Msg.HTML_FILE,"file"],[J.Msg.HTML_HIDDEN,"hidden"],[J.Msg.HTML_IMAGE,"image"],[J.Msg.HTML_MONTH,"month"],[J.Msg.HTML_RANGE,"range"],[J.Msg.HTML_RESET,"reset"],[J.Msg.HTML_SEARCH,"search"],[J.Msg.HTML_SUBMIT,"submit"],[J.Msg.HTML_TELEPHONENUMBER,"telephone number"],[J.Msg.HTML_TIME,"time"],[J.Msg.HTML_URL,"url"],[J.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(J.Msg.HTML_NAME).appendField(new J.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(J.Msg.HTML_VALUE).appendField(new J.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(J.Msg.MIXLY_AIP_ATTR).setAlign(J.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ls={init:function(){this.setColour(ms),this.appendDummyInput().appendField(new J.FieldTextInput("property"),"KEY").appendField(":").appendField(new J.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(ms),this.appendDummyInput().appendField(new J.FieldTextInput("property"),"KEY").appendField(":").appendField(new J.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ds={init:function(){this.setColour(ms),this.appendDummyInput().appendField(J.Msg.HTML_TEXT).appendField(new J.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fs=160,Ns={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new J.FieldTable(""),"TEXT")}},Ps={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new J.FieldMultilineInput(""),"TEXT")}},Fs={init:function(){this.setColour(fs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new J.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},vs={init:function(){this.setColour(fs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ys={init:function(){this.setColour(fs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new J.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},bs={init:function(){this.setColour(fs),this.appendValueInput("VALUE").appendField(J.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Vs={init:function(){this.setColour(fs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(J.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=J.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+r()+"("+t+", "+e+", "+i+")"},J.isNumber(n)&&J.isNumber(s)&&J.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Lu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Su=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Du=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},fu=function(t,e){return["None",e.ORDER_ATOMIC]},Nu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Pu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Fu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},vu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Yu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},bu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Vu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Xu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},yu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Uu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Bu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Gu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},wu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ku=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Hu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},xu=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Wu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ku=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ju=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ju=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Qu=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},qu=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},zu=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Zu=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},$u=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},ta=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},ea=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},ia=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),J.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Xa=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},ya=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Ua=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Ba=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ga=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},wa=function(t,e){return'"},ka=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Ha=function(){return this.getFieldValue("TEXT")+"\n"},xa=function(t){return t.getFieldValue("TEXT")+"\n"},Wa=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Ka=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Ja=function(){return""},ja=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Qa=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},za.scrubNakedValue=function(t){return t+"\n"},za.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},za.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},za.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=J.utils.string.wrap(o,za.COMMENT_WRAP-3),n+=za.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const Za={microbit:{description:"microbit_python",digital:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],pwm:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P5","5"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P19","19"],["P20","20"]],analog:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P4","4"],["P10","10"]],interrupt:[["P0","0"],["P1","1"],["P2","2"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],builtinimg:[["HEART","Image.HEART"],["HEART_SMALL","Image.HEART_SMALL"],["HAPPY","Image.HAPPY"],["SMILE","Image.SMILE"],["SAD","Image.SAD"],["CONFUSED","Image.CONFUSED"],["ANGRY","Image.ANGRY"],["ASLEEP","Image.ASLEEP"],["SURPRISED","Image.SURPRISED"],["SILLY","Image.SILLY"],["FABULOUS","Image.FABULOUS"],["MEH","Image.MEH"],["YES","Image.YES"],["NO","Image.NO"],["CLOCK12","Image.CLOCK12"],["CLOCK11","Image.CLOCK11"],["CLOCK10","Image.CLOCK10"],["CLOCK9","Image.CLOCK9"],["CLOCK8","Image.CLOCK8"],["CLOCK7","Image.CLOCK7"],["CLOCK6","Image.CLOCK6"],["CLOCK5","Image.CLOCK5"],["CLOCK4","Image.CLOCK4"],["CLOCK3","Image.CLOCK3"],["CLOCK2","Image.CLOCK2"],["CLOCK1","Image.CLOCK1"],["ARROW_N","Image.ARROW_N"],["ARROW_NE","Image.ARROW_NE"],["ARROW_E","Image.ARROW_E"],["ARROW_SE","Image.ARROW_SE"],["ARROW_S","Image.ARROW_S"],["ARROW_SW","Image.ARROW_SW"],["ARROW_W","Image.ARROW_W"],["ARROW_NW","Image.ARROW_NW"],["TRIANGLE","Image.TRIANGLE"],["TRIANGLE_LEFT","Image.TRIANGLE_LEFT"],["CHESSBOARD","Image.CHESSBOARD"],["DIAMOND","Image.DIAMOND"],["DIAMOND_SMALL","Image.DIAMOND_SMALL"],["SQUARE","Image.SQUARE"],["SQUARE_SMALL","Image.SQUARE_SMALL"],["RABBIT","Image.RABBIT"],["COW","Image.COW"],["MUSIC_CROTCHET","Image.MUSIC_CROTCHET"],["MUSIC_QUAVER","Image.MUSIC_QUAVER"],["MUSIC_QUAVERS","Image.MUSIC_QUAVERS"],["PITCHFORK","Image.PITCHFORK"],["XMAS","Image.XMAS"],["PACMAN","Image.PACMAN"],["TARGET","Image.TARGET"],["TSHIRT","Image.TSHIRT"],["ROLLERSKATE","Image.ROLLERSKATE"],["DUCK","Image.DUCK"],["HOUSE","Image.HOUSE"],["TORTOISE","Image.TORTOISE"],["BUTTERFLY","Image.BUTTERFLY"],["STICKFIGURE","Image.STICKFIGURE"],["GHOST","Image.GHOST"],["SWORD","Image.SWORD"],["GIRAFFE","Image.GIRAFFE"],["SKULL","Image.SKULL"],["UMBRELLA","Image.UMBRELLA"],["SNAKE","Image.SNAKE"],["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],imglist:[["ALL_CLOCKS","Image.ALL_CLOCKS"],["ALL_ARROWS","Image.ALL_ARROWS"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["P0","0"],["P1","1"],["P2","2"],["P8","8"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]]}};Za["Mithon CC"]=Za.microbit;const $a=Za,tr=100,er={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",message0:J.Msg.MIXLY_MICROBIT_Play_built_in_melody,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Play_built_in_melody1)}},ir={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#built-in-melodies",tooltip:"Play one of the built-in melodies. Indicate if you need to wait before continuing or continuously loop the melody.",message0:J.Msg.MIXLY_MICROBIT_Play_built_in_melody_easy,args0:[{name:"melody",options:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],type:"field_dropdown"},{type:"input_value",name:"PIN"},{type:"input_dummy"}]})}},nr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_TONE).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MIXLY_FREQUENCY),this.appendValueInput("duration").setCheck(Number).appendField(J.Msg.MIXLY_DURATION),this.appendDummyInput("").appendField(J.Msg.MIXLY_MILLIS).appendField(J.Msg.MIXLY_MICROBIT_WAIT),this.appendDummyInput("").appendField(new J.FieldCheckbox(!0),"wait"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},sr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_TONE).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},or={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",message0:J.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"}]}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Play_notes1)}},_r={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,inputsInline:!0,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#musical-notation",tooltip:"Play a list of notes expressed in the special music language. Indicate if you need to wait before continuing or continuously loop the melody.",message0:J.Msg.MIXLY_MICROBIT_Play_notes,args0:[{check:"List",type:"input_value",name:"notes"},{type:"input_value",name:"PIN"},{type:"input_dummy"},{type:"input_dummy"},{type:"input_dummy"}]})}},ur={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.reset",message0:J.Msg.MIXLY_MICROBIT_Reset_music}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Reset_music)}},ar={init:function(){this.setColour(tr),this.appendValueInput("PIN").appendField(J.Msg.MIXLY_NOTONE).appendField(J.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_NOTONE)}},rr={init:function(){this.jsonInit({colour:tr,output:"Array",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.get_tempo",message0:J.Msg.MIXLY_MICROBIT_Get_current_tempo}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Get_current_tempo)}},pr={init:function(){this.setColour(tr),this.appendValueInput("TICKS").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(J.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(J.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_SET_TEMPO1)}},lr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,"say"],[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,"sing"],[J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE,"pronounce"]]),"MODE"),this.appendValueInput("pitch").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_pitch),this.appendValueInput("speed").setCheck(Number).appendField(J.Msg.MIXLY_SPEED),this.appendValueInput("mouth").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_mouth),this.appendValueInput("throat").setCheck(Number).appendField(J.Msg.MICROBIT_SPEECH_throat),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH,n=J.Msg.MIXLY_MICROBIT_TYPE_STRING;return i+{say:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY,sing:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING,pronounce:J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE}[e]+n}))}},Ir={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Tr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},dr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},hr={init:function(){this.setColour(tr),this.appendValueInput("VAR").setCheck(String).appendField(J.Msg.MICROBIT_SPEECH_translation),this.setOutput(!0,String),this.setTooltip(J.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+J.Msg.MIXLY_MICROBIT_TYPE_STRING+J.Msg.MICROBIT_SPEECH_translation)}},Mr={init:function(){this.setColour(tr),this.appendValueInput("PIN",Number).appendField(J.Msg.MIXLY_SERVO).appendField(J.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERVO_MOVE)}},mr={init:function(){this.appendValueInput("speed").setCheck(null).appendField(J.Msg.MIXLY_MOTOR).appendField(new J.FieldDropdown([["M1","1"],["M2","2"],["M3","3"],["M4","4"]]),"Motor").appendField(J.Msg.MIXLY_SPEED),this.appendDummyInput().appendField(new J.FieldDropdown([["Forward","1*"],["Reverse","-1*"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(tr),this.setTooltip(""),this.setHelpUrl("")}},cr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_RGB_PIN_COUNT)}},Or={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(J.Msg.MIXLY_RGB_NUM_R_G_B)}},Er={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").setAlign(J.inputs.Align.RIGHT).appendField(new J.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_RGB),this.appendDummyInput().appendField(J.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(J.Msg.MIXLY_ESP32_MUSIC_WRI)}},gr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.MIXLY_SETUP+" "+J.Msg.QJ00X_MP3),this.appendValueInput("RX").setAlign(J.inputs.Align.RIGHT).appendField("RX#"),this.appendValueInput("TX").setAlign(J.inputs.Align.RIGHT).appendField("TX#"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Cr=[[J.Msg.MIXLY_MP3_PLAY,"play"],[J.Msg.MIXLY_MP3_PAUSE,"pause"],[J.Msg.MIXLY_MP3_NEXT,"next_track"],[J.Msg.MIXLY_MP3_PREV,"prev_track"],[J.Msg.MIXLY_MP3_VOL_UP,"inc_vol"],[J.Msg.MIXLY_MP3_VOL_DOWN,"dec_vol"]];const Ar={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Cr),"CONTROL_TYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Lr=[[J.Msg.MIXLY_MP3_LOOP_ALL,"0"],[J.Msg.MIXLY_MP3_LOOP_FOLDER,"1"],[J.Msg.MIXLY_MP3_LOOP_ONE,"2"],[J.Msg.MIXLY_MP3_LOOP_RAM,"3"]];const Sr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_LOOP_MODE).appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Lr),"LOOP_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Dr=[[J.Msg.MIXLY_MP3_EQ_NORMAL,"0"],[J.Msg.MIXLY_MP3_EQ_POP,"1"],[J.Msg.MIXLY_MP3_EQ_ROCK,"2"],[J.Msg.MIXLY_MP3_EQ_JAZZ,"3"],[J.Msg.MIXLY_MP3_EQ_CLASSIC,"4"],[J.Msg.MIXLY_MP3_EQ_BASS,"5"]];const fr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_EQ_MODE).appendField(J.Msg.MIXLY_STAT).appendField(new J.FieldDropdown(Dr),"EQ_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Nr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(J.Msg.MIXLY_MP3_VOL),this.appendValueInput("vol",Number).appendField(J.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Pr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Fr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(J.Msg.QJ00X_MP3),this.appendValueInput("FOLDER",Number).appendField(J.Msg.DFPLAYER_MINI_FOLDER).setCheck(Number),this.appendValueInput("NUM",Number).appendField(J.Msg.MIXLY_MP3_PLAY_NUM).setCheck(Number),this.appendDummyInput("").appendField("首"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},vr=140,Yr={init:function(){this.setColour(225),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"on"],[J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"off"],[J.Msg.HTML_RESET,"reset"]]),"type").appendField(J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type"),i=J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_WIFI;return{on:J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,off:J.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,reset:J.Blockly.Msg.HTML_RESET}[e]+i}))}},br={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.on",tooltip:"Turn on the radio. This needs to be explicitly called since the radio draws power and takes up memory that you may otherwise need.",message0:J.Msg.MIXLY_MICROBIT_Switch_on_radio})}},Vr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.off",tooltip:"Turn off the radio, thus saving power and memory.",message0:J.Msg.MIXLY_MICROBIT_Switch_off_radio})}},Xr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.config",tooltip:J.Msg.MIXLY_MICROBIT_Configure_radio1,message0:J.Msg.MIXLY_MICROBIT_Configure_radio,args0:[{min:4,value:32,type:"input_value",max:251,name:"length"},{type:"input_dummy"},{min:1,value:3,type:"input_value",max:32,name:"queue"},{type:"input_dummy"},{min:0,value:7,type:"input_value",max:100,name:"channel"},{type:"input_dummy"},{name:"power",type:"input_value"},{type:"input_dummy"},{name:"address",type:"input_value"},{type:"input_dummy"},{name:"group",type:"input_value"},{type:"input_dummy"},{name:"data_rate",type:"input_value"}]})}},yr={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.reset",tooltip:"Reset the radio to default settings.",message0:J.Msg.MIXLY_MICROBIT_Reset_radio})}},Ur={init:function(){this.jsonInit({colour:225,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.send",tooltip:"Broadcast a text message.",message0:J.Msg.MIXLY_MICROBIT_Send_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},Br={init:function(){this.setColour(225),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_RADIO_SEND),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_MSG,"send"],[J.Msg.MIXLY_MICROBIT_MSG_BYTE,"send_bytes"]]),"type"),this.appendValueInput("data"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_Send_message1)}},Gr={init:function(){this.jsonInit({colour:225,output:"String",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.receive",tooltip:J.Msg.MIXLY_MICROBIT_Receive_message,message0:J.Msg.MIXLY_MICROBIT_Receive_message})}},wr={init:function(){this.setColour(225),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_Receive_message),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_MSG,"receive"],[J.Msg.MIXLY_MICROBIT_MSG_BYTE,"receive_bytes"],[J.Msg.MIXLY_MICROBIT_MSG_FULL,"receive_full"]]),"type"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_Receive_message)}},kr={init:function(){this.setColour(vr),this.appendValueInput("RX",Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_SETUP).appendField("sda").setCheck(Number).setAlign(J.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("scl").setCheck(Number).setAlign(J.inputs.Align.RIGHT),this.appendValueInput("freq").setCheck(Number).appendField("频率").setAlign(J.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Hr={init:function(){this.setColour(vr),this.appendValueInput("address").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_READ_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.LANG_MATH_BYTE),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new J.FieldCheckbox(!1),"is_repeated"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_I2C_READ)}},xr={init:function(){this.setColour(vr),this.appendValueInput("address").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_WRITE_ADDRESS),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendDummyInput().appendField(J.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new J.FieldCheckbox(!1),"is_repeated"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_I2C_WRITE)}},Wr={init:function(){this.jsonInit({colour:vr,nextStatement:null,previousStatement:null,message0:J.Msg.MIXLY_MICROBIT_SPI_INIT,args0:[{value:1e6,type:"field_number",name:"freq"},{type:"input_dummy"},{value:8,type:"field_number",name:"bits"},{type:"input_dummy"},{value:0,type:"field_number",name:"mode"},{type:"input_dummy"},{name:"mosi",options:j.Profile.default.digital,type:"field_dropdown"},{name:"miso",options:j.Profile.default.digital,type:"field_dropdown"},{name:"sck",options:j.Profile.default.digital,type:"field_dropdown"}]}),this.setFieldValue("15","mosi"),this.setFieldValue("14","miso"),this.setFieldValue("13","sck")}},Kr={init:function(){this.setColour(vr),this.appendValueInput("data").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_SPI_WRITE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_SPI_WRITE)}},Jr=180,jr={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:J.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Clear_display)}},Qr={init:function(){this.setColour(Jr),this.appendValueInput("x").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_GET).appendField(J.Msg.MIXLY_BRIGHTNESS).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(J.Msg.MIXLY_BRIGHTNESS1)}},qr={init:function(){this.setColour(Jr),this.appendValueInput("x").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SET_BRIGHTNESS).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("brightness").setCheck(Number).appendField(J.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_BRIGHTNESS2)}},zr={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck([String,"microbit_image"]).appendField(J.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_SHOW_IMAGE_OR_STRING)}},Zr={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$r={init:function(){this.setColour(Jr),this.appendValueInput("data").setCheck(String).appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("delay").setCheck(null).appendField(J.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(J.Msg.MIXLY_MILLIS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tp={init:function(){this.setColour(Jr),this.appendValueInput("PIN",String).setCheck("microbit_image").appendField(J.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.OLED_BITMAP)}},ep={init:function(){this.jsonInit({colour:Jr,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:J.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}]})}},ip={init:function(){this.jsonInit({colour:Jr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:J.Msg.MIXLY_MICROBIT_Animate_images_or_string,args0:[{check:[String,"List"],type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+J.Msg.MIXLY_MICROBIT_Animate_images1)}},np={init:function(){this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.jsonInit({colour:Jr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:J.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING)}},sp={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:J.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},op={init:function(){this.setColour(Jr),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[J.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(J.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=J.Msg.MIXLY_MICROBIT_monitor;return{on:J.Msg.MIXLY_MICROBIT_Turn_on_display,off:J.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},_p={init:function(){this.jsonInit({colour:Jr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:J.Msg.MIXLY_MICROBIT_Turn_off_display})}},up={init:function(){this.jsonInit({colour:Jr,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:J.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Display_is_on1)}},ap={init:function(){this.jsonInit({colour:Jr,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SMILE","SMILE"],["SAD","SAD"],["CONFUSED","CONFUSED"],["ANGRY","ANGRY"],["ASLEEP","ASLEEP"],["SURPRISED","SURPRISED"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["MEH","MEH"],["YES","YES"],["NO","NO"],["CLOCK12","CLOCK12"],["CLOCK11","CLOCK11"],["CLOCK10","CLOCK10"],["CLOCK9","CLOCK9"],["CLOCK8","CLOCK8"],["CLOCK7","CLOCK7"],["CLOCK6","CLOCK6"],["CLOCK5","CLOCK5"],["CLOCK4","CLOCK4"],["CLOCK3","CLOCK3"],["CLOCK2","CLOCK2"],["CLOCK1","CLOCK1"],["ARROW_N","ARROW_N"],["ARROW_NE","ARROW_NE"],["ARROW_E","ARROW_E"],["ARROW_SE","ARROW_SE"],["ARROW_S","ARROW_S"],["ARROW_SW","ARROW_SW"],["ARROW_W","ARROW_W"],["ARROW_NW","ARROW_NW"],["TRIANGLE","TRIANGLE"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["CHESSBOARD","CHESSBOARD"],["DIAMOND","DIAMOND"],["DIAMOND_SMALL","DIAMOND_SMALL"],["SQUARE","SQUARE"],["SQUARE_SMALL","SQUARE_SMALL"],["RABBIT","RABBIT"],["COW","COW"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["PITCHFORK","PITCHFORK"],["XMAS","XMAS"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["SWORD","SWORD"],["GIRAFFE","GIRAFFE"],["SKULL","SKULL"],["UMBRELLA","UMBRELLA"],["SNAKE","SNAKE"],["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]],type:"field_dropdown"}],output:["microbit_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:J.Msg.MIXLY_MICROBIT_Built_in_image1,message0:J.Msg.MIXLY_MICROBIT_Built_in_image})}},rp={init:function(){this.jsonInit({colour:Jr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.copy",message0:J.Msg.MIXLY_MICROBIT_Copy_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Copy_image1)}},pp={init:function(){this.jsonInit({colour:Jr,args0:[{check:["microbit_image","List",String],type:"input_value",name:"image"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image.invert",message0:J.Msg.MIXLY_MICROBIT_Invert_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Invert_image1)}},lp={init:function(){this.jsonInit({colour:Jr,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"}],output:"microbit_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:J.Msg.MIXLY_MICROBIT_Create_image}),this.setTooltip(J.Msg.MIXLY_MICROBIT_Create_image1)}},Ip={init:function(){var t=[[J.Msg.MIXLY_UP,"up"],[J.Msg.MIXLY_DOWN,"down"],[J.Msg.MIXLY_LEFT,"left"],[J.Msg.MIXLY_RIGHT,"right"]];this.setColour(Jr),this.setOutput(!0,"microbit_image"),this.setInputsInline(!0),this.appendValueInput("img").appendField(J.Msg.DISPLAY_IMAGE_LET).setCheck(["microbit_image","List",String]),this.appendDummyInput("").appendField(J.Msg.DISPLAY_IMAGE_LET2).appendField(new J.FieldDropdown(t),"OP"),this.appendValueInput("val").appendField(J.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(J.Msg.DISPLAY_IMAGE_UNIT);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i=J.Msg.DISPLAY_IMAGE_LET,n=J.Msg.DISPLAY_IMAGE_LET2,s=J.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:J.Msg.MIXLY_UP,down:J.Msg.MIXLY_DOWN,left:J.Msg.MIXLY_LEFT,right:J.Msg.MIXLY_RIGHT}[t]+s}))}},Tp={init:function(){var t=[[J.Msg.MICROBIT_DISPLAY_UNION,"+"],[J.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(Jr),this.setOutput(!0,"microbit_image"),this.appendValueInput("A").appendField(J.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{"+":J.Msg.MIXLY_MICROBIT_image_add,"-":J.Msg.MIXLY_MICROBIT_image_reduce}[t]}))}},dp={init:function(){this.setColour(Jr),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(J.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},hp={init:function(){this.setColour(Jr),this.appendValueInput("device").setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_SETUP).appendField(J.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(J.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(J.Msg.MIXLY_SETUP+J.Msg.MIXLY_DF_LCD+J.Msg.MIXLY_LCD_ADDRESS)}},Mp={init:function(){this.setColour(Jr),this.appendValueInput("row",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(J.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(J.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},mp={init:function(){this.setColour(Jr),this.appendDummyInput().appendField(J.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new J.FieldDropdown([[J.Msg.MIXLY_ON,"on()"],[J.Msg.MIXLY_OFF,"off()"],[J.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[J.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(False)"],[J.Msg.MIXLY_LCD_BACKLIGHT,"backlight(True)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return J.Msg.LISTS_SET_INDEX_SET+J.Msg.MIXLY_DF_LCD+{"on()":J.Msg.MIXLY_ON,"off()":J.Msg.MIXLY_OFF,"clear()":J.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":J.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":J.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},cp={init:function(){this.appendDummyInput().appendField(J.Msg.MIXLY_DF_LCD+" OLED "+J.Msg.OLEDDISPLAY),this.appendValueInput("Text_line1","String").setAlign(J.inputs.Align.RIGHT).appendField("(128*64) "+J.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(J.inputs.Align.RIGHT).appendField(J.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Jr),this.setTooltip(J.Msg.MIXLY_DF_LCD+J.Msg.OLEDDISPLAY+J.Msg.MIXLY_MICROBIT_TYPE_STRING)}},Op={init:function(){var t=[[J.Msg.MIXLY_HEIGHT,"height"],[J.Msg.MIXLY_WIDTH,"width"]];this.setColour(Jr),this.appendDummyInput().appendField(J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+J.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("microbit_image"),this.appendDummyInput("").appendField(new J.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return J.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+J.Msg.MIXLY_MICROBIT_IMAGE+{height:J.Msg.MIXLY_HEIGHT,width:J.Msg.MIXLY_WIDTH}[t]}))}},Ep={init:function(){this.setColour(Jr),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new J.FieldDropdown([[J.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[J.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:J.Msg.MIXLY_LCD_STAT_CLEAR,1:J.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return J.Msg.MIXLY_DF_LCD+i[e]}))}},Rp="#777777",gp={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField("from ").appendField(new J.FieldTextInput("microbit"),"path").appendField(" import ").appendField(new J.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cp={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField("import ").appendField(new J.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ap={init:function(){this.setColour(Rp),this.appendDummyInput("").appendField(new J.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new J.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e0)var u="rgb_show.mixly_rgb_show("+(i-1)+", "+s+", "+o+", "+_+")\n";else u="rgb_show.mixly_rgb_show_all("+s+", "+o+", "+_+")\n";return u},JT=function(t,e){var i=this.getFieldValue("LED");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel",e.definitions_.import_rgb_show="import rgb_show",i>0)var n="rgb_show.mixly_rgb_show("+(i-1)+", 0, 0, 0)\n";else n="rgb_show.mixly_rgb_show_all(0, 0, 0)\n";return n},jT=function(t,e){var i=e.valueToCode(this,"_LED_",e.ORDER_ATOMIC),n=e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC),s=e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC),o=e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel",e.definitions_.import_rgb_show="import rgb_show","rgb_show.mixly_rgb_show("+i+", "+n+", "+s+", "+o+")\n"},QT=function(t,e){var i=this.getFieldValue("NUMBER"),n=e.valueToCode(this,"SPEED",e.ORDER_ATOMIC),s=this.getFieldValue("DIRECTION");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_motor_control="import motor_control",0==i)var o="motor_control.motor1("+n+", "+s+")\nmotor_control.motor2("+n+", "+s+")\nmotor_control.motor3("+n+", "+s+")\n";else if(1==i)o="motor_control.motor1("+n+", "+s+")\n";else if(2==i)o="motor_control.motor2("+n+", "+s+")\n";else if(3==i)o="motor_control.motor3("+n+", "+s+")\n";return o},qT=function(t,e){var i=this.getFieldValue("NUMBER");if(e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_motor_control="import motor_control",0==i)var n="motor_control.motor1(0)\nmotor_control.motor2(0)\nmotor_control.motor3(0)\n";else if(1==i)n="motor_control.motor1(0)\n";else if(2==i)n="motor_control.motor2(0)\n";else if(3==i)n="motor_control.motor3(0)\n";return n},zT=function(t,e){return["pin"+this.getFieldValue("NUMBER")+".read_analog()",e.ORDER_ATOMIC]},ZT=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"btn",e.ORDER_ATOMIC);e.setups_["on_"+i]="def on_"+i+"():\n while True:\n if "+i+".was_pressed():\n yield callback_"+i+"()\n else:\n yield\n\nfunc_"+i+" = on_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_"+i+")\n","def callback_"+i+"():\n"+n},$T=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=this.getFieldValue("gesture");e.setups_["on_"+i]="def on_gesture_"+i+'():\n while True:\n if accelerometer.is_gesture("'+i+'"):\n yield callback_gesture_'+i+"()\n else:\n yield\n\nfunc_gesture_"+i+" = on_gesture_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_gesture_"+i+")\n","def callback_gesture_"+i+"():\n"+n},td=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=this.getFieldValue("near");e.setups_["on_"+i]="def on_near_"+i+"():\n while True:\n if not pin"+i+".read_digital():\n yield callback_near_"+i+"()\n else:\n yield\n\nfunc_near_"+i+" = on_near_"+i+"()\n";var n=e.statementToCode(t,"DO");n=e.addLoopTrap(n,t.id)||e.PASS;return e.loops_[i+"_loop"]=" next(func_near_"+i+")\n","def callback_near_"+i+"():\n"+n},ed=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"TIMES",e.ORDER_ATOMIC),n=e.statementToCode(t,"DO");return"for _my_variable in range("+i+"):\n"+(n=e.addLoopTrap(n,t.id)||e.PASS)},id=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},nd=id,sd=id,od=id,_d=id,ud=id,ad=id,rd=id,pd=id,ld=id,Id=id,Td=id,dd=id,hd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".is_pressed()",e.ORDER_ATOMIC]},Md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".was_pressed()",e.ORDER_ATOMIC]},md=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".get_presses()",e.ORDER_ATOMIC]},cd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['"'+this.getFieldValue("gesture")+'"',e.ORDER_ATOMIC]},Od=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",'if accelerometer.is_gesture("'+this.getFieldValue("gesture")+'"):\n'+(e.statementToCode(this,"DO")||e.PASS)},Ed=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.is_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},Rd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.was_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",'if accelerometer.was_gesture("'+this.getFieldValue("gesture")+'"):\n'+(e.statementToCode(this,"DO")||e.PASS)},Cd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i,n=this.getFieldValue("GES");return"all"==n?i="accelerometer.get_gestures()":"current"==n&&(i="accelerometer.current_gesture()"),[i,e.ORDER_ATOMIC]},Ad=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.current_gesture()",e.ORDER_ATOMIC]},Ld=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.get_"+this.getFieldValue("key")+"()",e.ORDER_ATOMIC]},Sd=function(){return"input.setAccelerometerRange("+this.getFieldValue("key")+")\n"},Dd=function(t,e){return["input.lightLevel()",e.ORDER_ATOMIC]},fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.calibrate()\n"},Nd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.is_calibrated()",e.ORDER_ATOMIC]},Pd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.heading()",e.ORDER_ATOMIC]},Fd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["temperature()",e.ORDER_ATOMIC]},vd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass."+this.getFieldValue("compass")+"()",e.ORDER_ATOMIC]},Yd=function(t,e){return["input.rotation("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},bd=function(t,e){return["input.magneticForce("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},Vd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="import ultrasonic",["ultrasonic.distance_cm(t_pin=pin"+i+", e_pin=pin"+n+")",e.ORDER_ATOMIC]},Xd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.setups_.class_hrsc04_="class HCSR04:\n def __init__(self, tpin=pin"+i+", epin=pin"+n+', spin=pin13):\n self.trigger_pin = tpin\n self.echo_pin = epin\n self.sclk_pin = spin\n\n def distance_mm(self):\n spi.init(baudrate=125000, sclk=self.sclk_pin,\n mosi=self.trigger_pin, miso=self.echo_pin)\n pre = 0\n post = 0\n k = -1\n length = 500\n resp = bytearray(length)\n resp[0] = 0xFF\n spi.write_readinto(resp, resp)\n # find first non zero value\n try:\n i, value = next((ind, v) for ind, v in enumerate(resp) if v)\n except StopIteration:\n i = -1\n if i > 0:\n pre = bin(value).count("1")\n # find first non full high value afterwards\n try:\n k, value = next((ind, v)\n for ind, v in enumerate(resp[i:length - 2]) if resp[i + ind + 1] == 0)\n post = bin(value).count("1") if k else 0\n k = k + i\n except StopIteration:\n i = -1\n dist= -1 if i < 0 else round((pre + (k - i) * 8. + post) * 8 * 0.172)\n return dist\n\n def distance_cm(self):\n return self.distance_mm() / 10.0\n\nsonar=HCSR04()\n\n',["sonar.distance_cm()",e.ORDER_ATOMIC]},yd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *"},Ud=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *";var i=this.getFieldValue("TIME_TYPE");switch(i){case"Year":case"Month":case"Day":case"Hour":case"Minute":case"Second":case"Week":return["ds."+i+"()",e.ORDER_ASSIGNMENT];case"Mix1":return["ds.get_date()",e.ORDER_ASSIGNMENT];case"Mix2":return["ds.get_time()",e.ORDER_ASSIGNMENT]}},Bd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_time("+e.valueToCode(this,"hour",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"minute",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"second",e.ORDER_ASSIGNMENT)+")\n"},Gd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *","ds.set_date("+e.valueToCode(this,"year",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"month",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"day",e.ORDER_ASSIGNMENT)+")\n"},wd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.clear_calibration()\n"},kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.read_light_level()",e.ORDER_ATOMIC]},Hd=function(t,e){var i=this.getFieldValue("Trig"),n=this.getFieldValue("Echo");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_ultrasonic="from ultrasonic import *","sonar = HCSR04(tpin=pin"+i+", epin=pin"+n+")\n"},xd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_TCS="from TCS import *",["tcs.getRawRGBData("+this.getFieldValue("TCS34725_COLOR")+")",e.ORDER_ATOMIC]},Wd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+"))\n"},Kd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+")+'\\r\\n')\n"},Jd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str(hex("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||"0")+")) + '\\r\\n')\n"},jd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"char_marker",e.ORDER_ATOMIC)||";",n=e.statementToCode(this,"DO");e.definitions_["func_serial_receive_data_event_"+i.charCodeAt(1)]="serial.onDataReceived("+i+", () => {\n"+n+"}\n"},Qd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.any()",e.ORDER_ATOMIC]},qd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.read()",e.ORDER_ATOMIC]},zd=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.readline()",e.ORDER_ATOMIC]},Zd=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["serial.readUntil("+this.getFieldValue("char_marker")+")",e.ORDER_ATOMIC]},$d=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"RX",e.ORDER_ATOMIC),n=e.valueToCode(this,"TX",e.ORDER_ATOMIC);return isNaN(parseInt(i))||(i="pin"+i),isNaN(parseInt(n))||(n="pin"+n),"uart.init(rx="+i+", tx="+n+", baudrate="+this.getFieldValue("baudrate")+")\n"},th=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.init(baudrate="+this.getFieldValue("baudrate")+")\n"},eh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},ih=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},nh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},sh=function(t,e){return"control.inBackground(() => {\n"+e.statementToCode(this,"do")+"})\n"},oh=function(){return"control.reset()\n"},_h=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||j.Profile.default.serial)+")\n"},uh=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||j.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||j.Profile.default.serial)+")\n"},ah=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||j.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||j.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},rh=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},ph=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},lh=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Ih=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},Th=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},dh=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},hh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Mh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},mh=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["running_time()",e.ORDER_ATOMIC]},ch=function(){return"while True:\n pass\n"},Oh=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","reset()\n"},Eh=function(t,e){return e.definitions_.import_os="import os",["os.uname()",e.ORDER_ATOMIC]};Object.assign(J.Variables,q),Object.assign(J.Procedures,Nn),J.Python=za,J.generator=za,j.Profile.default={},Object.assign(j.Profile,$a),Object.assign(j.Profile.default,$a.microbit),Object.assign(J.Blocks,e,i,n,s,o,_,u,a,r,p,l,I,T,D,f,N,N,P,F,v,Y,b,V,X),Object.assign(J.Python.forBlock,d,h,M,m,c,O,E,R,g,C,A,L,S,y,U,B,B,G,w,k,H,x,W,K)})(); \ No newline at end of file diff --git a/boards/default/micropython_robot/main.bundle.js b/boards/default/micropython_robot/main.bundle.js index 00cd84ab..d49989c9 100644 --- a/boards/default/micropython_robot/main.bundle.js +++ b/boards/default/micropython_robot/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class It{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ut.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ut.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ut.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ut.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Lt),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.PYTHON_RANGE).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Yt={init:function(){this.setColour(Lt),this.appendValueInput("LIST").setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ut.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ut.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xt={init:function(){this.setColour(Lt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ut.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ut.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ut.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ut.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},xt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ut.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},bt={init:function(){this.setColour(Lt);var t=new ut.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ut.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ut.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},yt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ut.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ut.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Vt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ut.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ut.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Xt.OPERATORS=[[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],bt.OPERATORS=[[ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Bt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Gt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Ut={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ut.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},wt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},kt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ht={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Wt={init:function(){this.jsonInit({message0:ut.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Lt,tooltip:ut.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ut.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Kt={init:function(){this.setColour(Lt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_STAT),this.setOutput(!0)}},Jt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Qt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},qt={init:function(){this.appendDummyInput().appendField(ut.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ut.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ut.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ut.FieldDropdown([[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},zt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Zt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_GET_UNIQUE_IDEN)}},te={init:function(){this.setColour(Lt),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ut.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ee=230;ut.FieldTextInput.math_number_validator=function(t){return String(t)},ut.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const ie={init:function(){this.setColour(ee),this.appendDummyInput().appendField(new ut.FieldTextInput("0",ut.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MATH_NUMBER_TOOLTIP)}},ne={init:function(){this.setColour(ee);this.appendDummyInput("").appendField(ut.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ut.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},se={init:function(){this.setColour(ee);this.appendDummyInput("").appendField(ut.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ut.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},oe={init:function(){this.setColour(ee),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ut.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ut.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ut.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},_e={init:function(){this.setColour(ee),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ut.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ut.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ut.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},pe={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ut.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},ae={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ut.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ut.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ut.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ut.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ut.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ut.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ut.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ut.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},ue={init:function(){var t=[[ut.Msg.MATH_BIN,"bin"],[ut.Msg.MATH_OCT,"oct"],[ut.Msg.MATH_HEX,"hex"]];this.setColour(ee),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ut.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ut.Msg.MATH_DEC_TOOLTIP_BIN,oct:ut.Msg.MATH_DEC_TOOLTIP_OCT,hex:ut.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},re={init:function(){var t=[[ut.Msg.LANG_MATH_TO_ROUND,"round"],[ut.Msg.LANG_MATH_TO_CEIL,"ceil"],[ut.Msg.LANG_MATH_TO_FLOOR,"floor"],[ut.Msg.MATH_ABS,"fabs"],[ut.Msg.MATH_SQRT,"sqrt"]];this.setColour(ee),this.appendValueInput("A").setCheck(Number).appendField(new ut.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ut.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ut.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ut.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ut.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ut.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ut.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},le={init:function(){var t=[[ut.Msg.MIXLY_MAX,"max"],[ut.Msg.MIXLY_MIN,"min"]];this.setColour(ee),this.appendValueInput("A").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ut.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ut.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ut.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},de={init:function(){var t=[[ut.Msg.MATH_TWO,"two"],[ut.Msg.MATH_EIGHT,"eight"],[ut.Msg.MATH_TEN,"ten"],[ut.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ee),this.appendDummyInput("").appendField(ut.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ut.FieldDropdown(t),"OP").appendField(ut.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MATH_ZHW).appendField(new ut.FieldDropdown(t),"OP2").appendField(ut.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:ut.Msg.MATH_Before_two,eight:ut.Msg.MATH_Before_eight,ten:ut.Msg.MATH_Before_ten,sixteen:ut.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:ut.Msg.MATH_Behind_two,eight:ut.Msg.MATH_Behind_eight,ten:ut.Msg.MATH_Behind_ten,sixteen:ut.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ie={init:function(){var t=[[ut.Msg.LANG_MATH_INT,"int"],[ut.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ee),this.setOutput(!0,Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ut.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:ut.Msg.LANG_MATH_INT,float:ut.Msg.LANG_MATH_FLOAT_RANDOM};return ut.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Te={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ut.Msg.MATH_CONSTRAIN_TOOLTIP)}},he={init:function(){this.setColour(ee),this.appendValueInput("NUM",Number).appendField(ut.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ut.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ut.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Me={init:function(){this.setColour(ee),this.appendDummyInput().appendField(new ut.FieldTextInput("0",ut.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ut.Msg.MATH_NUMBER_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("NUM").setCheck(Number).appendField(ut.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Ee={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MATH_ROUND).appendField(ut.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ut.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ut.Msg.MATH_ROUND_NEW_TOOLTIP)}},Oe={init:function(){var t=[[ut.Msg.MIXLY_TO_INT,"int"],[ut.Msg.MIXLY_TO_FLOAT,"float"],[ut.Msg.MIXLY_TO_BITES,"b"],[ut.Msg.LANG_MATH_BYTE+ut.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ut.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ut.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ut.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Re={init:function(){var t=[[ut.Msg.MIXLY_TO_INT,"int"],[ut.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ut.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ut.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ce=he,ge={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(ut.Msg.LANG_MATH_BYTE+ut.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ce={init:function(){this.setColour(ee),this.itemCount_=1,this.setMutator(new ut.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ut.Msg.MIXLY_PRODUCT+ut.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ut.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ut.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ut.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ne={init:function(){this.setColour(Se),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ut.FieldTextInput("",ut.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ut.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ut.FieldImage(e,7,12,'"')}},De={init:function(){this.setColour(Se),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ut.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},fe={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Fe={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(String).appendField(ut.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Pe={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ve={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ye={init:function(){this.WHERE_OPTIONS=[[ut.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ut.Msg.TEXT_GET_INDEX_RANDOM+1+ut.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.LISTS_GET_INDEX_GET,"MODE"),ut.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ut.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+ut.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ut.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:ut.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ut.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ut.Msg.TEXT_GET_INDEX_RANDOM};return ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+ut.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ut.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ut.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ut.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ut.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ut.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Xe={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ut.Msg.LISTS_GET_INDEX_GET+" "+ut.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ut.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+ut.Msg.LISTS_GET_INDEX_FROM_START+"n"+ut.Msg.TEXT_CHARAT2)}},xe={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ut.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ut.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},be={init:function(){this.WHERE_OPTIONS_1=[[ut.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ut.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ut.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ut.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ut.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ut.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==ut.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ut.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ut.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new ut.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ye={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ut.Msg.LISTS_GET_INDEX_GET+" "+ut.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ut.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ut.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ut.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ve={init:function(){var t=[[ut.Msg.MIXLY_EQUALS,"==="],[ut.Msg.MIXLY_STARTSWITH,"startswith"],[ut.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Se),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ut.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Be={init:function(){this.setColour(Se),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ut.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_COMPARETO_HELP)}},Ge={init:function(){var t=[[ut.Msg.TEXT_UPPER,"upper"],[ut.Msg.TEXT_TITLE,"title"],[ut.Msg.TEXT_CAPITALIZE,"capitalize"],[ut.Msg.TEXT_SWAPCASE,"swapcase"],[ut.Msg.TEXT_LOWER,"lower"]];this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ut.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ut.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ut.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ut.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ut.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ut.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ue={init:function(){var t=[[ut.Msg.TEXT_LJUST,"ljust"],[ut.Msg.TEXT_CENTER,"center"],[ut.Msg.TEXT_RJUST,"rjust"]];this.setColour(Se),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ut.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ut.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},we={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ut.Msg.MIXLY_MID+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ut.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},ke={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},He={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ut.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ut.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},We={init:function(){this.setColour(Se),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ut.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ut.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ke={init:function(){var t=[[ut.Msg.TEXT_TRIM_BOTH,"strip"],[ut.Msg.TEXT_TRIM_LEFT,"lstrip"],[ut.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Se),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ut.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ut.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ut.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ut.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ut.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Je={init:function(){this.setColour(Se),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ut.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ut.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wi={init:function(){this.setColour(Gi),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ki={init:function(){this.setColour(Gi),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Hi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_KEYS),this.setTooltip(ut.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Wi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ut.Msg.DICTS_GET_TOOLTIP)}},Ki={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ut.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ut.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Ji={init:function(){this.setColour(Gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ut.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Qi={init:function(){this.setColour(Gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_DELETE_TOOLTIP)}},qi={init:function(){this.setColour(Gi),this.appendValueInput("DICT2").setCheck("Dict").appendField(ut.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ut.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MID),this.setTooltip(ut.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_CLEAR),this.setTooltip(ut.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ji={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_ITEMS),this.setTooltip(ut.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Zi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_VALUES),this.setTooltip(ut.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_LENGTH),this.setTooltip(ut.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},tn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_DELDICT),this.setTooltip(ut.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},en={init:function(){this.MODE=[[ut.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ut.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ut.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ut.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ut.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ut.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ut.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},nn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.setTooltip(ut.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},sn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ut.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_SETDEFAULT_TOOLTIP)}},on={init:function(){this.setColour(Gi),this.appendDummyInput("").appendField(new ut.FieldLabel(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ut.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_n={init:function(){this.setColour(Gi),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},pn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TO_JSON),this.setTooltip(ut.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},an={init:function(){this.setColour(Gi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ut.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},un={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},rn=210,ln={init:function(){var t=ut.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ut.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ut.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ut.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ut.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ut.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ut.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},dn={init:function(){var t=ut.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ut.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ut.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},In={init:function(){var t=[[ut.Msg.LOGIC_OPERATION_AND,"AND"],[ut.Msg.LOGIC_OPERATION_OR,"OR"],[ut.Msg.LOGIC_OPERATION_NOR,"NOR"],[ut.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ut.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ut.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ut.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ut.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ut.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Tn={init:function(){this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ut.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ut.Msg.LOGIC_NEGATE_TOOLTIP)}},hn={init:function(){var t=[[ut.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ut.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ut.FieldDropdown(t),"BOOL"),this.setTooltip(ut.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Mn={init:function(){this.setColour(rn),this.setOutput(!0),this.appendDummyInput().appendField(ut.Msg.LOGIC_NULL),this.setTooltip(ut.Msg.LOGIC_NULL_TOOLTIP)}},mn={init:function(){this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(ut.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ut.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},En={init:function(){var t=[[ut.Msg.TEXT_APPEND_TO,"in"],[ut.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ut.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ut.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.IN)}},On={init:function(){var t=[[ut.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ut.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Rn={init:function(){this.setColour(rn),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},cn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ut.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},gn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG,_=ut.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ut.Msg.MIXPY_TEXT_ENCODE).appendField(new ut.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG,_=ut.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},An={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ut.Msg.MICROBIT_PYTHON_TYPE)}},fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.HTML_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},vn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Yn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Vn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ut.Msg.MIXLY_ESP32_SET+{mkdir:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ut.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.HTML_FILE,"isfile"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},wn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ut.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ut.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Hn={};Hn.NAME_TYPE=ut.PROCEDURE_CATEGORY_NAME,Hn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(ut.Msg.MIXLY_AIP_ATTR).setAlign(ut.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Gs={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_FORM_CONTENT).appendField(new ut.FieldDropdown([[ut.Msg.HTML_TEXT,"text"],[ut.Msg.HTML_EMAIL,"email"],[ut.Msg.HTML_NUMBER,"number"],[ut.Msg.HTML_PASSWORD,"password"],[ut.Msg.HTML_CHECKBOX,"checkbox"],[ut.Msg.HTML_RADIOBUTTON,"radiobutton"],[ut.Msg.HTML_BUTTON,"button"],[ut.Msg.HTML_COLOUR,"colour"],[ut.Msg.HTML_DATE,"date"],[ut.Msg.HTML_LOCALTIME,"local time"],[ut.Msg.HTML_FILE,"file"],[ut.Msg.HTML_HIDDEN,"hidden"],[ut.Msg.HTML_IMAGE,"image"],[ut.Msg.HTML_MONTH,"month"],[ut.Msg.HTML_RANGE,"range"],[ut.Msg.HTML_RESET,"reset"],[ut.Msg.HTML_SEARCH,"search"],[ut.Msg.HTML_SUBMIT,"submit"],[ut.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ut.Msg.HTML_TIME,"time"],[ut.Msg.HTML_URL,"url"],[ut.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ut.Msg.HTML_NAME).appendField(new ut.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ut.Msg.HTML_VALUE).appendField(new ut.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ut.Msg.MIXLY_AIP_ATTR).setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(new ut.FieldTextInput("property"),"KEY").appendField(":").appendField(new ut.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ws={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(new ut.FieldTextInput("property"),"KEY").appendField(":").appendField(new ut.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_TEXT).appendField(new ut.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs=160,Ws={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ut.FieldTable(""),"TEXT")}},Ks={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ut.FieldMultilineInput(""),"TEXT")}},Js={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ut.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Qs={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},qs={init:function(){this.setColour(Hs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ut.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},zs={init:function(){this.setColour(Hs),this.appendValueInput("VALUE").appendField(ut.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},js={init:function(){this.setColour(Hs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ut.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ut.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ut.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},ut.isNumber(n)&&ut.isNumber(s)&&ut.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Up=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},wp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},kp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Hp=function(t,e){return["None",e.ORDER_ATOMIC]},Wp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Kp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Qp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},qp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},zp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},jp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Zp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ta=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ea=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},na=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},sa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},oa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},_a=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},pa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},aa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ua=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ra=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},la=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},da=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},ma=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ea=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),ut.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Za=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},$a=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},tu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},eu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},iu=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},nu=function(t,e){return'"},su=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},ou=function(){return this.getFieldValue("TEXT")+"\n"},_u=function(t){return t.getFieldValue("TEXT")+"\n"},pu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},au=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},uu=function(){return""},ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},lu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Iu.scrubNakedValue=function(t){return t+"\n"},Iu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Iu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Iu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ut.utils.string.wrap(o,Iu.COMMENT_WRAP-3),n+=Iu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Tu="#74A55B",hu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ut.Msg.MIXLY_RGB_PIN_COUNT)}},Mu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},mu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Eu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Ou={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ut.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ut.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Ru={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},cu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_RESET)}},gu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Su={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Au={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Lu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Nu={init:function(){this.setColour(Tu),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Du={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_MOVE)}},fu={init:function(){this.setColour(Tu),this.appendValueInput("VAR").appendField("360°"+ut.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SETTING+ut.Msg.blockpy_turtle_rotate+ut.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Fu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("180°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_MOVE)}},Pu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("360°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},vu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("180°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Yu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("360°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new ut.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(ut.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},xu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ut.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[ut.Msg.MOTOR_N,"ms32006.MOT_N"],[ut.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},bu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new ut.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ut.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},yu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ut.Msg.MIXLY_RGB_PIN_COUNT)}},Vu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Bu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Gu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_WRI)}},Uu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new ut.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+ut.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},wu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ku={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Hu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(ut.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},Wu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(ut.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(ut.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Ku={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},Ju={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Qu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},qu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_TRAFFIC_LIGHT).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LISTS_SET_INDEX_SET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_WHITE,"W"],[ut.Msg.COLOUR_RGB_RED,"R"],[ut.Msg.COLOUR_RGB_YELLOW,"Y"],[ut.Msg.COLOUR_RGB_GREEN,"G"],[ut.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ju={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_WHITE,"W"],[ut.Msg.COLOUR_RGB_RED,"R"],[ut.Msg.COLOUR_RGB_YELLOW,"Y"],[ut.Msg.COLOUR_RGB_GREEN,"G"],[ut.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},Zu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[ut.Msg.MIXLY_SPEED,"[1]"],[ut.Msg.MATH_SINGLE_OP_ABSOLUTE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[ut.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[ut.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[ut.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},$u={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},er={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MATH_SINGLE_OP_ABSOLUTE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"0"],[ut.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[ut.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},ir={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField("("+ut.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},sr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField("("+ut.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"0"],[ut.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MOTOR,"ext_motor"],[ut.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ut.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ut.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ut.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ut.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ut.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ut.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MOTOR,"ext_motor"],[ut.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ut.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ut.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ut.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ut.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ut.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ut.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr="#6C9858",ar={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},ur={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_ON,"1"],[ut.Msg.MIXLY_ESP32_OFF,"0"],[ut.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},rr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},lr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},dr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ir={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_BUILDIN_LED+ut.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Tr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(ut.Msg.MIXLY_LCD_SETCOLOR).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LIGHT_RED,"1"],[ut.Msg.MIXLY_LIGHT_GREEN,"2"],[ut.Msg.MIXLY_LIGHT_BLUE,"3"],[ut.Msg.MIXLY_LIGHT_YELLOW,"4"],[ut.Msg.MIXLY_LIGHT_CYAN,"5"],[ut.Msg.MIXLY_LIGHT_PURPLE,"6"],[ut.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},hr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},Mr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},mr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Er={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_BUILDIN_LED+ut.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Or={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Rr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},cr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},gr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Cr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.PYTHON_RANGE_STEP).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Sr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_WRI)}},Ar={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Lr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Nr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.PYTHON_RANGE_STEP).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Dr={init:function(){this.setColour(pr),this.appendValueInput("TICKS").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ut.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ut.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},fr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Fr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_RESET)}},Pr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},vr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Yr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xr={init:function(){this.setColour(pr),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},xr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"],[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},br={init:function(){this.setColour(pr),this.appendDummyInput().appendField("MixGo Car").appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField("MixGo Car").appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Vr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([[ut.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ut.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Br={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([[ut.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ut.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_STOP).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Gr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Ur={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ut.Msg.MIXLY_SPEED,"SPEED"],[ut.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},wr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},kr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.MIXLY_MOTOR).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"1"],[ut.Msg.TEXT_TRIM_RIGHT,"2"],[ut.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ut.Msg.MIXLY_SPEED,"SPEED"],[ut.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Hr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[ut.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(ut.Msg.MIXLY_MOTOR).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"0"],[ut.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"],[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(pr),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},qr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},zr={init:function(){this.setColour(pr),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_MIXBOT_BUZZER+ut.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},jr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_MIXBOT_BUZZER+ut.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Zr={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_RECORD_AUDIO).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(ut.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_PLAY_AUDIO).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},tl={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},il={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nl={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.LISTS_SET_INDEX_SET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},sl={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT+ut.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},ol={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.LISTS_SET_INDEX_SET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.MIXLY_ALL+ut.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(ut.ALIGN_RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT+ut.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},_l={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.ANALOG+ut.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(ut.Msg.MIXLY_RELEASE).appendField(new ut.FieldDropdown([[ut.Msg.MICROPYTHON_DISPLAY_YES,"True"],[ut.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.ANALOG+ut.Msg.MIXLY_KEYBOARD_INPUT)}},pl={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SPECIAL_KEY).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[ut.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[ut.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[ut.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[ut.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[ut.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[ut.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[ut.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[ut.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},al={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GENERAL_KEY).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ul={init:function(){this.setColour(pr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new ut.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(ut.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Em={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Om={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Rm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},cm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ut.Msg.MIXLY_WIFI_USERNAME).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ut.Msg.MIXLY_IOT_PASSWORD).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ut.Msg.MIXLY_EMQX_PROJECT).setAlign(ut.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ut.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ut.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Cm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ut.Msg.MIXLY_EMQX_SUBSCRIBE+ut.Msg.MIXLY_MICROBIT_MSG).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ut.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Sm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Am={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ut.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Dm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},fm={init:function(){this.setColour(lm),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Fm={init:function(){this.setColour(lm),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Pm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},vm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO").appendField(ut.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ut.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Ym={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+ut.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xm={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(lm),this.appendDummyInput("").appendField(new ut.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},bm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO").appendField(ut.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},ym={init:function(){this.setColour(lm),this.appendDummyInput().appendField("HTTP"+ut.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ut.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ut.Msg.MIXLY_REQUESTS_GET).appendField(ut.Msg.MIXLY_GET_CURRENT_TIME).appendField(ut.Msg.MIXLY_OPEN_DEBUG).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("HTTP"+ut.Msg.MIXLY_Client).appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ut.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ut.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MQTT"+ut.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ut.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ut.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ut.Msg.MQTT_Topic).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ut.Msg.MIXLY_OPEN_DEBUG).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MQTT"+ut.Msg.MIXLY_Client).appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ut.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ut.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Um=dm,wm=Im,km=Tm,Hm=hm,Wm=mm,Km=225,Jm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(ut.Msg.MIXLY_NETWORK_MODE).appendField(new ut.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},Qm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[ut.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=ut.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:ut.Msg.MIXLY_NETWORK_WIFI_OPEN,False:ut.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},qm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},zm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return ut.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:ut.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},jm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(ut.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(ut.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},Zm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_CONNECT+ut.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},$m={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[ut.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[ut.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:ut.Msg.MIXLY_ESP32_NETWORK_IP,1:ut.Msg.MIXLY_ESP32_NETWORK_MASK,2:ut.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},tE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},eE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[ut.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},iE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(ut.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(ut.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},nE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},sE={init:function(){this.setColour(Km),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new ut.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},oE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},_E={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},pE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},aE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},uE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},rE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},lE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},dE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},IE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},TE={init:function(){this.setColour(Km),this.appendValueInput("DOMAIN").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_REQUESTS_GET).appendField(new ut.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},hE={init:function(){this.appendValueInput("VAL");var t=[[ut.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ut.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ut.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ut.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},ME={init:function(){this.appendValueInput("VAR").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ut.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ut.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ut.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},mE={init:function(){this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(ut.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},EE={init:function(){this.setColour(Km),this.appendDummyInput("").appendField(new ut.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},OE="#3288dd",RE={init:function(){this.setColour(OE),this.appendValueInput("URL").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ut.Msg.blockpy_REQUESTS).appendField(ut.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},cE={init:function(){this.setColour(OE),this.appendValueInput("URL").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ut.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ut.Msg.blockpy_REQUESTS+ut.Msg.OLED_STRING),this.appendDummyInput("").appendField(ut.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},gE={init:function(){this.appendValueInput("VAL");var t=[[ut.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ut.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(OE),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},CE="#A58C5B",SE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(ut.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SENOR_IS_PRESSED)}},AE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(ut.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SENOR_WAS_PRESSED)}},LE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_BUTTON+ut.Msg.MIXLY_GET_PRESSES)}},NE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ut.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ut.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},DE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_shake,"shake"],[ut.Msg.MIXLY_UP,"up"],[ut.Msg.MIXLY_DOWN,"down"],[ut.Msg.MIXLY_LEFT,"left"],[ut.Msg.MIXLY_RIGHT,"right"],[ut.Msg.MIXLY_MICROBIT_face_up,"face up"],[ut.Msg.MIXLY_MICROBIT_face_down,"face down"],[ut.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ut.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ut.Msg.MSG.catSensor,s=ut.Msg.MIXLY_MICROBIT_JS_STATE,o=ut.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ut.Msg.MIXLY_MICROBIT_shake,up:ut.Msg.MIXLY_UP,down:ut.Msg.MIXLY_DOWN,left:ut.Msg.MIXLY_LEFT,right:ut.Msg.MIXLY_RIGHT,"face up":ut.Msg.MIXLY_MICROBIT_face_up,"face down":ut.Msg.MIXLY_MICROBIT_face_down,freefall:ut.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},fE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},FE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},PE={init:function(){var t=[[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(CE),this.appendValueInput("PIN",Number).appendField(new ut.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new ut.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},vE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},YE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},XE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"left"],[ut.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(ut.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=ut.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=ut.Msg.MIXLY_ESP32_NEAR;return i+{left:ut.Msg.TEXT_TRIM_LEFT,right:ut.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},xE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[ut.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":ut.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":ut.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},bE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[ut.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},yE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},VE={init:function(){this.setColour(CE),this.appendDummyInput("").appendField("LM35"+ut.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_LM35)}},BE={init:function(){this.setColour(CE),this.appendValueInput("I2CSUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ut.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},GE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[ut.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[ut.Msg.MIXLY_ESP32_MAX30102_IR+","+ut.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},UE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[ut.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[ut.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},wE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},kE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.HTML_COLOUR+ut.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET+ut.Msg.HTML_COLOUR,"[2]"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_IR_STRENGTH,"[1]"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},HE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.HTML_COLOUR+ut.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET+"RGB"+ut.Msg.HTML_COLOUR,"0"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_RGB_RAW,"1"],[ut.Msg.MIXLY_GET_ENV_LIGHT+ut.Msg.MIXLY_BRIGHTNESS,"2"],[ut.Msg.GET_IR_STRENGTH+ut.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},WE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET_ENV_LIGHT,"E"],[ut.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},KE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},JE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},QE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},qE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_Altitude+ut.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETPRESSURE,"pressure()"],[ut.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ut.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},zE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_Altitude+ut.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETPRESSURE,"pressure()"],[ut.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ut.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},jE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MIXGOPE_FIELD+ut.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[ut.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_shake,"shake"],[ut.Msg.MIXLY_UP,"up"],[ut.Msg.MIXLY_DOWN,"down"],[ut.Msg.MIXLY_LEFT,"left"],[ut.Msg.MIXLY_RIGHT,"right"],[ut.Msg.MIXLY_MICROBIT_face_up,"face up"],[ut.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ut.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ut.Msg.MSG.catSensor,s=ut.Msg.MIXLY_MICROBIT_JS_STATE,o=ut.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ut.Msg.MIXLY_MICROBIT_shake,up:ut.Msg.MIXLY_UP,down:ut.Msg.MIXLY_DOWN,left:ut.Msg.MIXLY_LEFT,right:ut.Msg.MIXLY_RIGHT,"face up":ut.Msg.MIXLY_MICROBIT_face_up,"face down":ut.Msg.MIXLY_MICROBIT_face_down}[e]+o}))}},$E={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},tO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_GET+ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},eO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+ut.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},iO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},nO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_GETTEMPERATUE)}},sO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return ut.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},oO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},_O={init:function(){this.setColour(CE),this.appendValueInput("SPISUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ut.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},pO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[ut.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},rO={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ut.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},lO={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ut.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(ut.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},dO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RFID_SCAN_OK,"0"],[ut.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[ut.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},IO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},TO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},hO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},MO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ut.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&o)):(2048<=o&&o<=55295||57344<=o&&o<=65535)&&(n+=3,i.push(224|15&o>>12),i.push(128|63&o>>6),i.push(128|63&o))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==_?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+o+",font_address="+p+")\n"):"16x8 Matrix"==_&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+o+")\n"),i},nN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},oN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},_N=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},pN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},aN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},uN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},rN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},lN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},dN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},IN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},TN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},hN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},MN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},mN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},EN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},ON=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},RN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},cN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),_=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+o+", "+_+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+o+", "+_+","+a+")\n"}},gN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},CN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},SN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},AN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},LN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},NN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),_="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(_){case"True":return i+".show_fill_circle("+n+", "+s+", "+o+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+o+", "+p+")\n"}},DN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),_=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n"}},fN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},FN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},PN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},vN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},YN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},XN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},xN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},bN=function(t,e){e.definitions_.import_st7789="import st7789";var i=rt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+o+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+_+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},yN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},VN=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},BN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},GN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},UN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},wN=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},kN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),o=e.valueToCode(this,"x2",e.ORDER_ATOMIC),_=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+o+", "+_+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+o+", "+_+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},HN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),o=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+o+")\n"},WN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},KN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},JN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},QN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},qN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),o=rt.Boards.getSelectedBoardKey().split(":")[2],_="";return _=["mpython","mixgo_pe","mixgo_nova"].indexOf(o)>=0?"0x700000":["mixgo_zero"].indexOf(o)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+_+")\n"},zN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},ZN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$N=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},tD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},eD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},nD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},oD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},_D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},pD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},aD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+o+", "+_+", "+p+")\n"+i+".show()\n"},uD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\n"+i+".show()\n"},rD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},lD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),o=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+o+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+o+")\n")},ID=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},TD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},hD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},MD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},mD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},ED=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},OD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let o="",_=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),_+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);o+=n(_.toString(16)),s.unshift(o)}let o=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},jD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},ZD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},$D=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},tf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},ef=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},nf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},sf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==_.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},of=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),o=e.valueToCode(t,"x2",e.ORDER_ATOMIC),_=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},_f=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},pf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},af=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},uf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var _="onboard_tft.pixel(int("+n+"), int("+s+"), "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return _},rf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},lf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},df=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},If=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=_+"=Clock("+n+","+s+","+o+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=_+"=Clock("+n+","+s+","+o+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Tf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},hf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},Mf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},mf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var o=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o=n+".clear(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\n"}return o},Ef=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"r",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==_.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", "+_+","+p+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Of=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Rf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},cf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},gf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},mX=function(){return"control.reset()\n"},EX=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||rt.Profile.default.serial)+")\n"},OX=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||rt.Profile.default.serial)+")\n"},RX=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},cX=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},gX=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},CX=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},SX=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},AX=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},LX=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},NX=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},DX=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},fX=function(){return"while True:\n pass\n"},FX=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},PX=function(t,e){return e.definitions_.import_os="import os","os.uname()"},vX=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},YX=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},XX=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},xX=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},bX=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},yX=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},VX=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},BX=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},GX=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},UX=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},wX=yX,kX=xX,HX=bX,WX=vX,KX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},JX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},QX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},qX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},zX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ZX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},$X=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},tx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ex=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ix=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},nx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},sx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ox=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},_x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},px={};px["飞乙"]={description:"MicroPython[ESP32C3 Bitbot]",digital_pin:rt.Profile.generate(["0-11","18-21"]),input_pin:rt.Profile.generate(["0-11","18-21"]),output_pin:rt.Profile.generate(["0-11","18-21"]),pwm_input:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:rt.Profile.generate(["0-5"],"adc","adc"),pwm_output:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:rt.Profile.generate(["0-5"],"adc","adc"),espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),digital:rt.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:rt.Profile.generate(["0-11","18-21"]),pwm:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:rt.Profile.generate(["0-5"]),analog:rt.Profile.generate(["0-5"],"adc","adc"),button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]],extern_addr:rt.Profile.generate(["0-1"]),als_num:rt.Profile.generate(["0-3"])},px["超霸大师"]={description:"MicroPython[ESP32 Mixbot]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["P","button_p"],["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]],extern_addr:rt.Profile.generate(["0-3"])},px["ESP32 Generic"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin11","pin11"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},px["机器人大师"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["p","button_p"],["cw","button_cw"],["ccw","button_ccw"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]};const ax=px,ux=230,rx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital),"PIN"),this.setOutput(!0)}},lx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},dx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},Ix={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},Tx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch_mpython),"PIN"),this.setOutput(!0,Number)}},hx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},Mx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},mx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},Ex={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Ox={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Rx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},cx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},gx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Cx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Sx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ax={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Lx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},Nx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog),"PIN"),this.setOutput(!0)}},Dx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},fx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.dac),"PIN"),this.setOutput(!0)}},Fx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Px={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},vx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},Yx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},Xx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},xx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch),"PIN"),this.setOutput(!0)}},bx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},yx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Vx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},Bx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},Gx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},Ux={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},wx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},kx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Hx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Wx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Kx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Jx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Qx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},qx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},zx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},jx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Zx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},$x={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},tb=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},eb=tb,ib=tb,nb=tb,sb=tb,ob=tb,_b=tb,pb=tb,ab=tb,ub=tb,rb=tb,lb=tb,db=tb,Ib=tb,Tb=tb,hb=tb,Mb=tb,mb=tb,Eb=tb,Ob=tb,Rb=tb,cb=tb,gb=tb,Cb=tb,Sb=tb,Ab=tb,Lb=tb,Nb=tb,Db=tb,fb=tb,Fb=tb,Pb=tb,vb=tb,Yb=tb,Xb=tb;Object.assign(ut.Variables,dt),Object.assign(ut.Procedures,Wn),ut.Python=Iu,ut.generator=Iu,rt.Profile.default={},Object.assign(rt.Profile,ax),Object.assign(rt.Profile.default,ax["ESP32 Generic"]),Object.assign(ut.Blocks,e,i,n,s,o,_,p,a,u,r,l,d,I,b,w,U,v,y,k,f,G,B,V,F,D,N,X,Y,x,P,pt),Object.assign(ut.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,$,ot,st,q,tt,_t,K,nt,it,et,J,W,H,j,z,Z,Q,at)})(); \ No newline at end of file +class It{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ut.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ut.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ut.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ut.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Lt),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.PYTHON_RANGE).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Yt={init:function(){this.setColour(Lt),this.appendValueInput("LIST").setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ut.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ut.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xt={init:function(){this.setColour(Lt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ut.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ut.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ut.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ut.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},xt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ut.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ut.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},bt={init:function(){this.setColour(Lt);var t=new ut.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ut.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ut.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},yt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ut.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ut.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Vt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ut.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ut.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Xt.OPERATORS=[[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],bt.OPERATORS=[[ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ut.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Bt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Gt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Ut={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ut.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},wt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},kt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ht={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ut.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Wt={init:function(){this.jsonInit({message0:ut.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Lt,tooltip:ut.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ut.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Kt={init:function(){this.setColour(Lt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_STAT),this.setOutput(!0)}},Jt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Qt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},qt={init:function(){this.appendDummyInput().appendField(ut.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ut.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ut.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ut.FieldDropdown([[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ut.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},zt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Zt={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Lt),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_GET_UNIQUE_IDEN)}},te={init:function(){this.setColour(Lt),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ut.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},ee=230;ut.FieldTextInput.math_number_validator=function(t){return String(t)},ut.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const ie={init:function(){this.setColour(ee),this.appendDummyInput().appendField(new ut.FieldTextInput("0",ut.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MATH_NUMBER_TOOLTIP)}},ne={init:function(){this.setColour(ee);this.appendDummyInput("").appendField(ut.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ut.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},se={init:function(){this.setColour(ee);this.appendDummyInput("").appendField(ut.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ut.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ut.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},oe={init:function(){this.setColour(ee),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ut.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ut.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ut.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},_e={init:function(){this.setColour(ee),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ut.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ut.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ut.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ut.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ut.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},pe={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ut.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},ae={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ut.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ut.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ut.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ut.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ut.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ut.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ut.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ut.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},ue={init:function(){var t=[[ut.Msg.MATH_BIN,"bin"],[ut.Msg.MATH_OCT,"oct"],[ut.Msg.MATH_HEX,"hex"]];this.setColour(ee),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ut.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ut.Msg.MATH_DEC_TOOLTIP_BIN,oct:ut.Msg.MATH_DEC_TOOLTIP_OCT,hex:ut.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},re={init:function(){var t=[[ut.Msg.LANG_MATH_TO_ROUND,"round"],[ut.Msg.LANG_MATH_TO_CEIL,"ceil"],[ut.Msg.LANG_MATH_TO_FLOOR,"floor"],[ut.Msg.MATH_ABS,"fabs"],[ut.Msg.MATH_SQRT,"sqrt"]];this.setColour(ee),this.appendValueInput("A").setCheck(Number).appendField(new ut.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ut.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ut.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ut.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ut.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ut.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ut.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},le={init:function(){var t=[[ut.Msg.MIXLY_MAX,"max"],[ut.Msg.MIXLY_MIN,"min"]];this.setColour(ee),this.appendValueInput("A").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ut.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ut.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ut.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},de={init:function(){var t=[[ut.Msg.MATH_TWO,"two"],[ut.Msg.MATH_EIGHT,"eight"],[ut.Msg.MATH_TEN,"ten"],[ut.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(ee),this.appendDummyInput("").appendField(ut.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ut.FieldDropdown(t),"OP").appendField(ut.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MATH_ZHW).appendField(new ut.FieldDropdown(t),"OP2").appendField(ut.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:ut.Msg.MATH_Before_two,eight:ut.Msg.MATH_Before_eight,ten:ut.Msg.MATH_Before_ten,sixteen:ut.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:ut.Msg.MATH_Behind_two,eight:ut.Msg.MATH_Behind_eight,ten:ut.Msg.MATH_Behind_ten,sixteen:ut.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ie={init:function(){var t=[[ut.Msg.LANG_MATH_INT,"int"],[ut.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(ee),this.setOutput(!0,Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ut.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ut.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:ut.Msg.LANG_MATH_INT,float:ut.Msg.LANG_MATH_FLOAT_RANDOM};return ut.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Te={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ut.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ut.Msg.MATH_CONSTRAIN_TOOLTIP)}},he={init:function(){this.setColour(ee),this.appendValueInput("NUM",Number).appendField(ut.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ut.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ut.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Me={init:function(){this.setColour(ee),this.appendDummyInput().appendField(new ut.FieldTextInput("0",ut.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ut.Msg.MATH_NUMBER_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("NUM").setCheck(Number).appendField(ut.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Ee={init:function(){this.setColour(ee),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MATH_ROUND).appendField(ut.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ut.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ut.Msg.MATH_ROUND_NEW_TOOLTIP)}},Oe={init:function(){var t=[[ut.Msg.MIXLY_TO_INT,"int"],[ut.Msg.MIXLY_TO_FLOAT,"float"],[ut.Msg.MIXLY_TO_BITES,"b"],[ut.Msg.LANG_MATH_BYTE+ut.Msg.MIXLY_TO_INT,"bti"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ut.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ut.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ut.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Re={init:function(){var t=[[ut.Msg.MIXLY_TO_INT,"int"],[ut.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ut.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ut.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ce=he,ge={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(ut.Msg.LANG_MATH_BYTE+ut.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ce={init:function(){this.setColour(ee),this.itemCount_=1,this.setMutator(new ut.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ut.Msg.MIXLY_PRODUCT+ut.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ut.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ut.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ut.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ne={init:function(){this.setColour(Se),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ut.FieldTextInput("",ut.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ut.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ut.FieldImage(e,7,12,'"')}},De={init:function(){this.setColour(Se),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ut.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},fe={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Fe={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(String).appendField(ut.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Pe={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ve={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ye={init:function(){this.WHERE_OPTIONS=[[ut.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ut.Msg.TEXT_GET_INDEX_RANDOM+1+ut.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.LISTS_GET_INDEX_GET,"MODE"),ut.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ut.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=ut.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+ut.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ut.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:ut.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ut.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ut.Msg.TEXT_GET_INDEX_RANDOM};return ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+ut.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ut.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ut.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ut.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ut.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ut.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Xe={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ut.Msg.LISTS_GET_INDEX_GET+" "+ut.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ut.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+ut.Msg.LISTS_GET_INDEX_FROM_START+"n"+ut.Msg.TEXT_CHARAT2)}},xe={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ut.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ut.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},be={init:function(){this.WHERE_OPTIONS_1=[[ut.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ut.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ut.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ut.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ut.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ut.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ut.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==ut.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ut.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ut.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new ut.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ye={init:function(){this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ut.Msg.LISTS_GET_INDEX_GET+" "+ut.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ut.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ut.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ut.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ve={init:function(){var t=[[ut.Msg.MIXLY_EQUALS,"==="],[ut.Msg.MIXLY_STARTSWITH,"startswith"],[ut.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Se),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ut.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Be={init:function(){this.setColour(Se),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ut.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_COMPARETO_HELP)}},Ge={init:function(){var t=[[ut.Msg.TEXT_UPPER,"upper"],[ut.Msg.TEXT_TITLE,"title"],[ut.Msg.TEXT_CAPITALIZE,"capitalize"],[ut.Msg.TEXT_SWAPCASE,"swapcase"],[ut.Msg.TEXT_LOWER,"lower"]];this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ut.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ut.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ut.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ut.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ut.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ut.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ue={init:function(){var t=[[ut.Msg.TEXT_LJUST,"ljust"],[ut.Msg.TEXT_CENTER,"center"],[ut.Msg.TEXT_RJUST,"rjust"]];this.setColour(Se),this.appendValueInput("VAR").appendField(new ut.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ut.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ut.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},we={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ut.Msg.MIXLY_MID+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ut.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},ke={init:function(){this.setColour(Se),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},He={init:function(){this.setColour(Se),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ut.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ut.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},We={init:function(){this.setColour(Se),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ut.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ut.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ke={init:function(){var t=[[ut.Msg.TEXT_TRIM_BOTH,"strip"],[ut.Msg.TEXT_TRIM_LEFT,"lstrip"],[ut.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Se),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ut.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ut.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ut.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ut.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ut.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ut.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Je={init:function(){this.setColour(Se),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ut.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ut.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wi={init:function(){this.setColour(Gi),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ki={init:function(){this.setColour(Gi),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Hi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_KEYS),this.setTooltip(ut.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Wi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ut.Msg.DICTS_GET_TOOLTIP)}},Ki={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ut.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ut.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Ji={init:function(){this.setColour(Gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ut.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Qi={init:function(){this.setColour(Gi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ut.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_DELETE_TOOLTIP)}},qi={init:function(){this.setColour(Gi),this.appendValueInput("DICT2").setCheck("Dict").appendField(ut.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ut.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MID),this.setTooltip(ut.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_CLEAR),this.setTooltip(ut.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ji={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_ITEMS),this.setTooltip(ut.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Zi={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_VALUES),this.setTooltip(ut.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},$i={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_LENGTH),this.setTooltip(ut.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},tn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.DICT_DELDICT),this.setTooltip(ut.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},en={init:function(){this.MODE=[[ut.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ut.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ut.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ut.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ut.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ut.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ut.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ut.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},nn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ut.Msg.DICTS_ADD_VALUE),this.setTooltip(ut.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},sn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ut.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ut.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_SETDEFAULT_TOOLTIP)}},on={init:function(){this.setColour(Gi),this.appendDummyInput("").appendField(new ut.FieldLabel(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ut.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_n={init:function(){this.setColour(Gi),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},pn={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TO_JSON),this.setTooltip(ut.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},an={init:function(){this.setColour(Gi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ut.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},un={init:function(){this.setColour(Gi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},rn=210,ln={init:function(){var t=ut.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ut.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ut.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ut.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ut.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ut.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ut.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},dn={init:function(){var t=ut.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ut.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ut.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},In={init:function(){var t=[[ut.Msg.LOGIC_OPERATION_AND,"AND"],[ut.Msg.LOGIC_OPERATION_OR,"OR"],[ut.Msg.LOGIC_OPERATION_NOR,"NOR"],[ut.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ut.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ut.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ut.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ut.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ut.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Tn={init:function(){this.setColour(rn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ut.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ut.Msg.LOGIC_NEGATE_TOOLTIP)}},hn={init:function(){var t=[[ut.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ut.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(rn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ut.FieldDropdown(t),"BOOL"),this.setTooltip(ut.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Mn={init:function(){this.setColour(rn),this.setOutput(!0),this.appendDummyInput().appendField(ut.Msg.LOGIC_NULL),this.setTooltip(ut.Msg.LOGIC_NULL_TOOLTIP)}},mn={init:function(){this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(ut.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ut.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},En={init:function(){var t=[[ut.Msg.TEXT_APPEND_TO,"in"],[ut.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ut.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ut.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.IN)}},On={init:function(){var t=[[ut.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ut.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(rn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ut.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Rn={init:function(){this.setColour(rn),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ut.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},cn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ut.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},gn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG,_=ut.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Sn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ut.Msg.MIXPY_TEXT_ENCODE).appendField(new ut.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_USE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ut.Msg.MIXLY_BELONG,_=ut.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},An={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ut.Msg.MIXLY_MICROBIT_TYPE_STRING+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ut.Msg.MICROBIT_PYTHON_TYPE)}},fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.HTML_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Fn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},vn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Yn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},yn={init:function(){this.setColour(0),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Vn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ut.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ut.Msg.MIXLY_ESP32_SET+{mkdir:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ut.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.HTML_FILE,"isfile"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ut.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},wn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ut.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ut.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Hn={};Hn.NAME_TYPE=ut.PROCEDURE_CATEGORY_NAME,Hn.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s"),this.appendValueInput("style").appendField(ut.Msg.MIXLY_AIP_ATTR).setAlign(ut.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Gs={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_FORM_CONTENT).appendField(new ut.FieldDropdown([[ut.Msg.HTML_TEXT,"text"],[ut.Msg.HTML_EMAIL,"email"],[ut.Msg.HTML_NUMBER,"number"],[ut.Msg.HTML_PASSWORD,"password"],[ut.Msg.HTML_CHECKBOX,"checkbox"],[ut.Msg.HTML_RADIOBUTTON,"radiobutton"],[ut.Msg.HTML_BUTTON,"button"],[ut.Msg.HTML_COLOUR,"colour"],[ut.Msg.HTML_DATE,"date"],[ut.Msg.HTML_LOCALTIME,"local time"],[ut.Msg.HTML_FILE,"file"],[ut.Msg.HTML_HIDDEN,"hidden"],[ut.Msg.HTML_IMAGE,"image"],[ut.Msg.HTML_MONTH,"month"],[ut.Msg.HTML_RANGE,"range"],[ut.Msg.HTML_RESET,"reset"],[ut.Msg.HTML_SEARCH,"search"],[ut.Msg.HTML_SUBMIT,"submit"],[ut.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ut.Msg.HTML_TIME,"time"],[ut.Msg.HTML_URL,"url"],[ut.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ut.Msg.HTML_NAME).appendField(new ut.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ut.Msg.HTML_VALUE).appendField(new ut.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ut.Msg.MIXLY_AIP_ATTR).setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(new ut.FieldTextInput("property"),"KEY").appendField(":").appendField(new ut.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ws={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(new ut.FieldTextInput("property"),"KEY").appendField(":").appendField(new ut.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Ys),this.appendDummyInput().appendField(ut.Msg.HTML_TEXT).appendField(new ut.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs=160,Ws={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ut.FieldTable(""),"TEXT")}},Ks={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ut.FieldMultilineInput(""),"TEXT")}},Js={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ut.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Qs={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},qs={init:function(){this.setColour(Hs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ut.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},zs={init:function(){this.setColour(Hs),this.appendValueInput("VALUE").appendField(ut.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},js={init:function(){this.setColour(Hs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ut.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ut.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ut.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},ut.isNumber(n)&&ut.isNumber(s)&&ut.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Up=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},wp=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},kp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Hp=function(t,e){return["None",e.ORDER_ATOMIC]},Wp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Kp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Jp=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Qp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},qp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},zp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},jp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Zp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},$p=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},ta=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ea=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ia=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},na=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},sa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},oa=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},_a=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},pa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},aa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ua=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ra=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},la=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},da=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ia=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ta=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ha=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Ma=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},ma=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ea=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),ut.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Za=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},$a=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},tu=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},eu=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},iu=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},nu=function(t,e){return'"},su=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},ou=function(){return this.getFieldValue("TEXT")+"\n"},_u=function(t){return t.getFieldValue("TEXT")+"\n"},pu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},au=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},uu=function(){return""},ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},lu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},Iu.scrubNakedValue=function(t){return t+"\n"},Iu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Iu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Iu.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ut.utils.string.wrap(o,Iu.COMMENT_WRAP-3),n+=Iu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const Tu="#74A55B",hu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MIDI),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PIN),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ut.Msg.MIXLY_RGB_PIN_COUNT)}},Mu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},mu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Eu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},Ou={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendValueInput("TICKS").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ut.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ut.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},Ru={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},cu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_RESET)}},gu={init:function(){this.setColour(Tu),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Su={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Au={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Lu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Nu={init:function(){this.setColour(Tu),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.MIXLY_SERVO),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Du={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_MOVE)}},fu={init:function(){this.setColour(Tu),this.appendValueInput("VAR").appendField("360°"+ut.Msg.MIXLY_SERVO),this.appendValueInput("SPEED",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SETTING+ut.Msg.blockpy_turtle_rotate+ut.Msg.MIXLY_SPEED+" (-10~10)"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_360_TOOLTIP)}},Fu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("180°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_MOVE)}},Pu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("360°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SERVO_SPEED_TOOLIPS)}},vu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("180°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Yu={init:function(){this.setColour(Tu),this.appendValueInput("PIN",Number).appendField("360°"+ut.Msg.MIXLY_SERVO).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},Xu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new ut.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(ut.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},xu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ut.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[ut.Msg.MOTOR_N,"ms32006.MOT_N"],[ut.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},bu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new ut.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"ms32006.MOT_CW"],[ut.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},yu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ut.Msg.MIXLY_RGB_PIN_COUNT)}},Vu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MP)}},Bu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Gu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_WRI)}},Uu={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"uart").appendField(new ut.FieldDropdown([["uart1","uart1"],["uart2","uart2"]]),"key"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO+"SYN6288"+ut.Msg.MIXLY_AipSpeech_synthesis),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},wu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_SET_VOLUME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},ku={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_VOLUME),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SET_VOLUME_TOOLTIP)}},Hu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_PLAY_HINTS),this.appendDummyInput().appendField(ut.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PLAY_HINTS_TOOLTIP)}},Wu={init:function(){this.setColour(Tu),this.appendValueInput("SUB").appendField("SYN6288"),this.appendValueInput("data").setCheck(String).appendField(ut.Msg.MIXLY_AipSpeech_synthesis),this.appendValueInput("VOICE").setCheck(Number).appendField(ut.Msg.MIXLY_BACKGROUND_MUSIC),this.appendDummyInput().appendField(ut.Msg.MIXLY_PROGRAM_BLOCK).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"mode"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_PLAY_TTS_TOOLTIP)}},Ku={init:function(){this.setColour(Tu),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.extern_addr),"PIN"),this.setOutput(!0,Number)}},Ju={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},Qu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_SPEED),this.setOutput(!0,Number),this.setInputsInline(!0)}},qu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_TRAFFIC_LIGHT).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.LISTS_SET_INDEX_SET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_Turn_off_display,"0"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_RED_ON,"1"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_RED_BLINK,"2"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_ON,"3"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_YELLOW_BLINK,"4"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_ON,"5"],[ut.Msg.MIXLY_TRAFFIC_LIGHT_GREEN_BLINK,"6"]]),"light"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},zu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_WHITE,"W"],[ut.Msg.COLOUR_RGB_RED,"R"],[ut.Msg.COLOUR_RGB_YELLOW,"Y"],[ut.Msg.COLOUR_RGB_GREEN,"G"],[ut.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendValueInput("value").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.BRIGHTNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},ju={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_WHITE,"W"],[ut.Msg.COLOUR_RGB_RED,"R"],[ut.Msg.COLOUR_RGB_YELLOW,"Y"],[ut.Msg.COLOUR_RGB_GREEN,"G"],[ut.Msg.COLOUR_RGB_BLUE,"B"]]),"color").appendField("LED").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.BRIGHTNESS),this.setOutput(!0,Number),this.setInputsInline(!0)}},Zu={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"[0]"],[ut.Msg.MIXLY_SPEED,"[1]"],[ut.Msg.MATH_SINGLE_OP_ABSOLUTE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[2]"],[ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"[3]"],[ut.Msg.MIXLY_MIXBOT_SERVO_BLOCK_OR_NOT,"[4]"],[ut.Msg.MIXLY_MIXBOT_SERVO_FINISH_OR_NOT,"[5]"],[ut.Msg.MIXLY_ALL,""]]),"status"),this.setOutput(!0,Number),this.setInputsInline(!0)}},$u={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_SET_STOP_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_KEEP,"0"],[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_COAST,"1"],[ut.Msg.MIXLY_MIXBOT_SERVO_STOP_MODE_BRAKE,"2"]]),"status"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},tr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_STOP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},er={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MATH_SINGLE_OP_ABSOLUTE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"0"],[ut.Msg.MIXLY_MIXBOT_SERVO_NEAREST_PATH,"1"],[ut.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.appendValueInput("angle").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_SERVO_ABSOLUTE_ANGLE_TOOLTIP)}},ir={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ORIGIN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},nr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField("("+ut.Msg.MIXLY_MIXBOT_SERVO_LIKE_ENCODING_MOTOR+")").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendValueInput("angle").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_DISPLAY_MATRIX_ROTATE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_SERVO_RELATIVE_ANGLE_TOOLTIP)}},sr={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.ME_GO_MOTOR_EXTERN+ut.Msg.MIXLY_SERVO_MOTOR).appendField(ut.Msg.MIXLY_RELATIVE+ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE+ut.Msg.MSG.run).appendField("("+ut.Msg.MIXLY_MIXBOT_SERVO_LIKE_ORDINARY_MOTOR+")").appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LEFT,"0"],[ut.Msg.MIXLY_RIGHT,"1"]]),"mode"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MODE).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPEED+ut.Msg.MIXLY_MODE,"0"],[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER+ut.Msg.MIXLY_MODE,"1"]]),"status"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField("%"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SERVO_TURN_DIRECTION).setAlign(ut.inputs.Align.RIGHT).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"0"],[ut.Msg.ANTI_CLOCKWISE,"2"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},or={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MOTOR,"ext_motor"],[ut.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ut.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ut.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ut.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ut.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ut.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ut.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_EXTERN_GET_ADDR),this.setOutput(!0),this.setInputsInline(!0)}},_r={init:function(){this.setColour(Tu),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.ME_GO_MOTOR_EXTERN).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MOTOR,"ext_motor"],[ut.Msg.MIXLY_TRAFFIC_LIGHT,"ext_traffic"],[ut.Msg.COLOUR_RGB_WHITE+"LED","W_LED"],[ut.Msg.COLOUR_RGB_RED+"LED","R_LED"],[ut.Msg.COLOUR_RGB_YELLOW+"LED","Y_LED"],[ut.Msg.COLOUR_RGB_GREEN+"LED","G_LED"],[ut.Msg.COLOUR_RGB_BLUE+"LED","B_LED"],[ut.Msg.MIXLY_SERVO_MOTOR,"ext_servo"]]),"name"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_EXTERN_SET_ADDR),this.appendValueInput("old").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.appendValueInput("new").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_UPDATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},pr="#6C9858",ar={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([["L1","1"],["L2","2"]]),"op"),this.setOutput(!0)}},ur={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_ON,"1"],[ut.Msg.MIXLY_ESP32_OFF,"0"],[ut.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},rr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},lr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},dr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Ir={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_BUILDIN_LED+ut.Msg.MIXLY_BRIGHTNESS+"(0-100%)")}},Tr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(ut.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput("").appendField(ut.Msg.MIXLY_LCD_SETCOLOR).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_LIGHT_RED,"1"],[ut.Msg.MIXLY_LIGHT_GREEN,"2"],[ut.Msg.MIXLY_LIGHT_BLUE,"3"],[ut.Msg.MIXLY_LIGHT_YELLOW,"4"],[ut.Msg.MIXLY_LIGHT_CYAN,"5"],[ut.Msg.MIXLY_LIGHT_PURPLE,"6"],[ut.Msg.MIXLY_LIGHT_WHITE,"7"]]),"colorvalue"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},hr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},Mr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ut.Msg.MIXLY_BRIGHTNESS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},mr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendDummyInput().appendField(ut.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Er={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_SETTING).appendField(ut.Msg.MIXLY_BUILDIN_LED).appendField(new ut.FieldDropdown([[ut.Msg.COLOUR_RGB_RED,"r"],[ut.Msg.COLOUR_RGB_GREEN,"g"]]),"color"),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_BRIGHTNESS),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_BUILDIN_LED+ut.Msg.MIXLY_BRIGHTNESS+"(0-10)")}},Or={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(new ut.FieldDropdown([["L1","20"],["L2","21"]]),"op"),this.setOutput(!0)}},Rr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgo_cc":case"micropython:esp32s2:mixgo_ce":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgo_me":default:this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},cr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},gr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RAINBOW),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Cr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.PYTHON_RANGE_STEP).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Sr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_WRI)}},Ar={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);switch(rt.Boards.getSelectedBoardKey()){case"micropython:esp32c3:mixgocc":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOCC);break;case"micropython:esp32c3:mixgome":default:this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MIXGOME);break;case"micropython:esp32:mPython":this.setTooltip(ut.Msg.MIXLY_RGB_NUM_R_G_B_MPYTHON)}}},Lr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(ut.Msg.MIXLY_RGB_ALL_R_G_B_MIXGOCC)}},Nr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RGB),this.appendDummyInput("").appendField(ut.Msg.MIXLY_CHASE),this.appendValueInput("RVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_RGB_B),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.PYTHON_RANGE_STEP).appendField(ut.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Dr={init:function(){this.setColour(pr),this.appendValueInput("TICKS").setCheck(Number).appendField(ut.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(ut.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(ut.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},fr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},Fr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_RESET)}},Pr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},vr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(ut.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Yr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xr={init:function(){this.setColour(pr),this.appendValueInput("LIST").appendField(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},xr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([["1","1"],["2","2"],["3","3"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"],[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},br={init:function(){this.setColour(pr),this.appendDummyInput().appendField("MixGo Car").appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},yr={init:function(){this.setColour(pr),this.appendDummyInput("").appendField("MixGo Car").appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}},Vr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([[ut.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ut.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_STEPPER_SET_SPEED),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Br={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MOTOR_DC).appendField(new ut.FieldDropdown([[ut.Msg.MIXLYCAR_WHEEL_LEFT,"L"],[ut.Msg.MIXLYCAR_WHEEL_RIGHT,"R"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_STOP).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Gr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_MOTOR_STATUS),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_STATUS_TOOLTIP)}},Ur={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ut.Msg.MIXLY_SPEED,"SPEED"],[ut.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},wr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},kr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXBOT).appendField(ut.Msg.MIXLY_MOTOR).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"1"],[ut.Msg.TEXT_TRIM_RIGHT,"2"],[ut.Msg.TEXT_TRIM_BOTH,"0"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BLE_POWER,"PWR"],[ut.Msg.MIXLY_SPEED,"SPEED"],[ut.Msg.MIXLY_MIXBOT_MOTOR_TURNS,"TURNS"]]),"mode"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOVE_TOOLTIP)}},Hr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_BUZZER),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_ON,"0"],[ut.Msg.MIXLY_MICROBIT_PY_COMMUNICATE_OFF,"1"]]),"on_off"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(new ut.FieldDropdown([[ut.Msg.blockpy_forward,"F"],[ut.Msg.blockpy_backward,"B"],[ut.Msg.blockpy_left,"L"],[ut.Msg.blockpy_right,"R"]]),"VAR"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Kr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(new ut.FieldDropdown([[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"VAR"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Jr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.BITBOT).appendField(ut.Msg.MIXLY_MOTOR).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"0"],[ut.Msg.TEXT_TRIM_RIGHT,"1"]]),"wheel"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Direction).appendField(new ut.FieldDropdown([[ut.Msg.CLOCKWISE,"CW"],[ut.Msg.ANTI_CLOCKWISE,"CCW"],[ut.Msg.MOTOR_P,"P"],[ut.Msg.MOTOR_N,"N"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.MIXLY_SPEED),this.appendDummyInput("").appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},Qr={init:function(){this.setColour(pr),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_MIXBOT_SOUND_SET_LOUDNESS),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},qr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_MIXBOT_SOUND_LOUDNESS+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},zr={init:function(){this.setColour(pr),this.appendValueInput("bright").appendField(ut.Msg.MIXLY_SETTING+ut.Msg.MIXLY_MIXBOT_BUZZER+ut.Msg.MIXLY_MP3_VOL),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_SETONOFF)}},jr={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.MIXLY_MIXBOT_BUZZER+ut.Msg.MIXLY_MP3_VOL+"(%)"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_LED_GETONOFF)}},Zr={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_RECORD_AUDIO).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendValueInput("TIME").setCheck(Number).appendField(ut.Msg.MIXLY_GET_PRESSES_TIME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$r={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_PLAY_AUDIO).appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},tl={init:function(){this.setColour(pr),this.appendValueInput("PATH").appendField(ut.Msg.MIXLY_PLAY_ONLINE_AUDIO).appendField("URL"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},el={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(ut.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},il={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nl={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.LISTS_SET_INDEX_SET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendValueInput("duty").setCheck(Number).setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},sl={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.PIN_NUMBERING).appendField(new ut.FieldDropdown([["1","1"],["2","2"]]),"index"),this.appendDummyInput().setAlign(ut.inputs.Align.RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT+ut.Msg.MIXLY_DUTY_RATIO),this.setOutput(!0,Number),this.setInputsInline(!0)}},ol={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.LISTS_SET_INDEX_SET+ut.Msg.ME_GO_MOTOR_EXTERN).appendField(ut.Msg.MIXLY_ALL+ut.Msg.PIN_NUMBERING),this.appendValueInput("duty").setCheck(Number).setAlign(ut.ALIGN_RIGHT).appendField(ut.Msg.blynk_IOT_IR_POWER+ut.Msg.MIXLY_PINMODEOUT+ut.Msg.MIXLY_FREQUENCY),this.appendDummyInput().appendField("Hz"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP)}},_l={init:function(){this.setColour(pr),this.appendDummyInput().appendField(ut.Msg.ANALOG+ut.Msg.MIXLY_KEYBOARD_INPUT),this.appendValueInput("special"),this.appendValueInput("general"),this.appendDummyInput().appendField(ut.Msg.MIXLY_RELEASE).appendField(new ut.FieldDropdown([[ut.Msg.MICROPYTHON_DISPLAY_YES,"True"],[ut.Msg.MICROPYTHON_DISPLAY_NO,"False"]]),"release"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.ANALOG+ut.Msg.MIXLY_KEYBOARD_INPUT)}},pl={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SPECIAL_KEY).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPECIAL_KEY0,"0x00"],[ut.Msg.MIXLY_SPECIAL_KEY1,"0x01"],[ut.Msg.MIXLY_SPECIAL_KEY2,"0x02"],[ut.Msg.MIXLY_SPECIAL_KEY1,"0x04"],[ut.Msg.MIXLY_SPECIAL_KEY8,"0x08"],[ut.Msg.MIXLY_SPECIAL_KEY16,"0x10"],[ut.Msg.MIXLY_SPECIAL_KEY32,"0x20"],[ut.Msg.MIXLY_SPECIAL_KEY64,"0x40"],[ut.Msg.MIXLY_SPECIAL_KEY128,"0x80"]]),"op"),this.setOutput(!0)}},al={init:function(){this.setColour(pr),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GENERAL_KEY).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_SPECIAL_KEY0,"0x00"],["A","0x04"],["B","0x05"],["C","0x06"],["D","0x07"],["E","0x08"],["F","0x09"],["G","0x0A"],["H","0x0B"],["I","0x0C"],["J","0x0D"],["K","0x0E"],["L","0x0F"],["M","0x10"],["N","0x11"],["O","0x12"],["P","0x13"],["Q","0x14"],["R","0x15"],["S","0x16"],["T","0x17"],["U","0x18"],["V","0x19"],["W","0x1A"],["X","0x1B"],["Y","0x1C"],["Z","0x1D"],["1 !","0x1E"],["2 @","0x1F"],["3 #","0x20"],["4 $","0x21"],["5 %","0x22"],["6 ^","0x23"],["7 &","0x24"],["8 *","0x25"],["9 (","0x26"],["0 )","0x27"],["ENTER","0x28"],["ESC","0x29"],["BACKSPACE","0x2A"],["TAB","0x2B"],["SPACE","0x2C"],["- _","0x2D"],["= +","0x2E"],["[ {","0x2F"],["] }","0x30"],["\\ |","0x31"],["; :","0x33"],["' \"","0x34"],["` ~","0x35"],[", <","0x36"],[". >","0x37"],["/ ?","0x38"],["CAPS_LOCK","0x39"],["F1","0x3A"],["F2","0x3B"],["F3","0x3C"],["F4","0x3D"],["F5","0x3E"],["F6","0x3F"],["F7","0x40"],["F8","0x41"],["F9","0x42"],["F10","0x43"],["F11","0x44"],["F12","0x45"],["PRINTSCREEN","0x46"],["SCROLL_LOCK","0x47"],["PAUSE","0x48"],["INSERT","0x49"],["HOME","0x4A"],["PAGE_UP","0x4B"],["DELETE","0x4C"],["END","0x4D"],["PAGE_DOWN","0x4E"],["RIGHT","0x4F"],["LEFT","0x50"],["DOWN","0x51"],["UP","0x52"],["NUM_LOCK","0x53"],["/","0x54"],["*","0x55"],["-","0x56"],["+","0x57"],["ENTER","0x58"],["1","0x59"],["2","0x5A"],["3","0x5B"],["4","0x5C"],["5","0x5D"],["6","0x5E"],["7","0x5F"],["8","0x60"],["9","0x61"],["0","0x62"],[".","0x63"]]),"op"),this.setOutput(!0)}},ul={init:function(){this.setColour(pr),this.itemCount_=2,this.updateShape_(),this.setOutput(!0),this.setMutator(new ut.icons.MutatorIcon(["generalkey_create_with_item"],this)),this.setTooltip(ut.Msg.GENERALKEY_TUPLE_CREATE_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("generalkey_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Em={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Om={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Rm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},cm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ut.Msg.MIXLY_WIFI_USERNAME).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ut.Msg.MIXLY_IOT_PASSWORD).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ut.Msg.MIXLY_EMQX_PROJECT).setAlign(ut.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ut.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ut.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Cm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ut.Msg.MIXLY_EMQX_SUBSCRIBE+ut.Msg.MIXLY_MICROBIT_MSG).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ut.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Sm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Am={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ut.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Dm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ut.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},fm={init:function(){this.setColour(lm),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Fm={init:function(){this.setColour(lm),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Pm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ut.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},vm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO").appendField(ut.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ut.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Ym={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+ut.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xm={init:function(){this.setColour(lm),this.appendDummyInput().appendField(ut.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ut.Msg.MIXLY_EMQX_SERVER).setAlign(ut.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ut.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xm={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(lm),this.appendDummyInput("").appendField(new ut.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},bm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MixIO").appendField(ut.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},ym={init:function(){this.setColour(lm),this.appendDummyInput().appendField("HTTP"+ut.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ut.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ut.Msg.MIXLY_REQUESTS_GET).appendField(ut.Msg.MIXLY_GET_CURRENT_TIME).appendField(ut.Msg.MIXLY_OPEN_DEBUG).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("HTTP"+ut.Msg.MIXLY_Client).appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ut.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ut.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MQTT"+ut.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ut.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ut.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ut.Msg.MQTT_Topic).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ut.Msg.MIXLY_OPEN_DEBUG).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ut.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gm={init:function(){this.setColour(lm),this.appendDummyInput().appendField("MQTT"+ut.Msg.MIXLY_Client).appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ut.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ut.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Um=dm,wm=Im,km=Tm,Hm=hm,Wm=mm,Km=225,Jm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(ut.Msg.MIXLY_NETWORK_MODE).appendField(new ut.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},Qm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[ut.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_FLAG),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("op"),i=ut.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:ut.Msg.MIXLY_NETWORK_WIFI_OPEN,False:ut.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},qm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},zm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return ut.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:ut.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},jm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(ut.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(ut.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},Zm={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_NETWORK_WIFI_CONNECT+ut.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},$m={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[ut.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[ut.Msg.MIXLY_ESP32_NETWORK_GATEWAY,"2"],["DNS","3"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:ut.Msg.MIXLY_ESP32_NETWORK_IP,1:ut.Msg.MIXLY_ESP32_NETWORK_MASK,2:ut.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},tE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},eE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[ut.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},iE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.LISTS_SET_INDEX_SET),this.appendValueInput("essid").setCheck(String).appendField(ut.Msg.MIXLY_NETWORK_WIFI_ESSID),this.appendValueInput("channel").setCheck(Number).appendField(ut.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},nE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(ut.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},sE={init:function(){this.setColour(Km),this.appendValueInput("VAR").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new ut.FieldDropdown([["TCP","TCP"],["UDP","UDP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("mode");return ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},oE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},_E={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},pE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},aE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},uE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},rE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},lE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},dE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},IE={init:function(){this.setColour(Km),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},TE={init:function(){this.setColour(Km),this.appendValueInput("DOMAIN").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_REQUESTS_GET).appendField(new ut.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ut.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},hE={init:function(){this.appendValueInput("VAL");var t=[[ut.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]];this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ut.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ut.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ut.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},ME={init:function(){this.appendValueInput("VAR").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ut.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ut.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ut.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},mE={init:function(){this.setColour(Km),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(ut.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},EE={init:function(){this.setColour(Km),this.appendDummyInput("").appendField(new ut.FieldDropdown([["ntp.aliyun.com","ntp.aliyun.com"],["ntp1.aliyun.com","ntp1.aliyun.com"],["ntp2.aliyun.com","ntp2.aliyun.com"],["ntp3.aliyun.com","ntp3.aliyun.com"],["ntp4.aliyun.com","ntp4.aliyun.com"],["ntp5.aliyun.com","ntp5.aliyun.com"],["ntp6.aliyun.com","ntp6.aliyun.com"],["ntp7.aliyun.com","ntp7.aliyun.com"],["time1.cloud.tencent.com","time1.cloud.tencent.com"],["time2.cloud.tencent.com","time2.cloud.tencent.com"],["time3.cloud.tencent.com","time3.cloud.tencent.com"],["time4.cloud.tencent.com","time4.cloud.tencent.com"],["time5.cloud.tencent.com","time5.cloud.tencent.com"]]),"op"),this.setOutput(!0)}},OE="#3288dd",RE={init:function(){this.setColour(OE),this.appendValueInput("URL").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ut.Msg.blockpy_REQUESTS).appendField(ut.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},cE={init:function(){this.setColour(OE),this.appendValueInput("URL").appendField(ut.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ut.Msg.blockpy_CONDUCT).appendField(new ut.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ut.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ut.Msg.blockpy_REQUESTS+ut.Msg.OLED_STRING),this.appendDummyInput("").appendField(ut.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},gE={init:function(){this.appendValueInput("VAL");var t=[[ut.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ut.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ut.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(OE),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},CE="#A58C5B",SE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_IS_PRESSED),this.appendValueInput("STAT").appendField(ut.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SENOR_IS_PRESSED)}},AE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_WAS_PRESSED),this.appendValueInput("STAT").appendField(ut.Msg.MIXLY_ELECLEVEL),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_SENOR_WAS_PRESSED)}},LE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(ut.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.PROCEDURES_DEFRETURN_RETURN+ut.Msg.MIXLY_BUTTON+ut.Msg.MIXLY_GET_PRESSES)}},NE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_BUTTON).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MODE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[ut.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[ut.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},DE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_shake,"shake"],[ut.Msg.MIXLY_UP,"up"],[ut.Msg.MIXLY_DOWN,"down"],[ut.Msg.MIXLY_LEFT,"left"],[ut.Msg.MIXLY_RIGHT,"right"],[ut.Msg.MIXLY_MICROBIT_face_up,"face up"],[ut.Msg.MIXLY_MICROBIT_face_down,"face down"],[ut.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(ut.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ut.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ut.Msg.MSG.catSensor,s=ut.Msg.MIXLY_MICROBIT_JS_STATE,o=ut.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ut.Msg.MIXLY_MICROBIT_shake,up:ut.Msg.MIXLY_UP,down:ut.Msg.MIXLY_DOWN,left:ut.Msg.MIXLY_LEFT,right:ut.Msg.MIXLY_RIGHT,"face up":ut.Msg.MIXLY_MICROBIT_face_up,"face down":ut.Msg.MIXLY_MICROBIT_face_down,freefall:ut.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},fE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_ADXL345).setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},FE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_ESP32_SENSOR_LIGHT_LEVEL_TOOLTIP)}},PE={init:function(){var t=[[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]];this.setColour(CE),this.appendValueInput("PIN",Number).appendField(new ut.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new ut.FieldDropdown(t),"WHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHAT");return{temperature:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:ut.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[t]}))}},vE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},YE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_SOUND),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},XE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ut.FieldDropdown([[ut.Msg.TEXT_TRIM_LEFT,"left"],[ut.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(ut.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=ut.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=ut.Msg.MIXLY_ESP32_NEAR;return i+{left:ut.Msg.TEXT_TRIM_LEFT,right:ut.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},xE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[ut.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":ut.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":ut.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},bE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[ut.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},yE={init:function(){this.setColour(CE),this.appendValueInput("PIN",Number).appendField("DS18X20 "+ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_MICROBIT_SENSOR_DS18X20_TOOLTIP)}},VE={init:function(){this.setColour(CE),this.appendDummyInput("").appendField("LM35"+ut.Msg.MIXLY_TEMP),this.appendValueInput("PIN",Number).appendField(ut.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ut.Msg.MIXLY_TOOLTIP_LM35)}},BE={init:function(){this.setColour(CE),this.appendValueInput("I2CSUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ut.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"],["LTR308","LTR308"],["LTR381RGB","LTR381RGB"],["UCS12071","UCS12071"],["LTR390UV","LTR390UV"],["HP203X","HP203X"],["SPL06_001","SPL06_001"],["SHTC3","SHTC3"],["AHT21","AHT21"],["VL53L0X","VL53L0X"],["QMC5883L","QMC5883L"],["MAX30102","MAX30102"],["APDS9960","APDS9960"],["RFID","RFID"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("LTR308","key")}},GE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_MAX30102+" MAX30102"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_MAX30102_IR,"[0]"],[ut.Msg.MIXLY_ESP32_MAX30102_RED,"[1]"],[ut.Msg.MIXLY_ESP32_MAX30102_IR+","+ut.Msg.MIXLY_ESP32_MAX30102_RED,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},UE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_APDS9960+" APDS9960"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_ESP32_APDS9960_COLOR,"color"],[ut.Msg.MIXLY_ESP32_APDS9960_GESTURE,"gesture"],[ut.Msg.MIXLY_ESP32_APDS9960_APPROACH,"proximity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},wE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_ESP32_EXTERN_LIGHT+" LTR308"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_LIGHT_INTENSITY),this.setOutput(!0,Number),this.setInputsInline(!0)}},kE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.HTML_COLOUR+ut.Msg.MSG.catSensor+" LTR381RGB").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET+ut.Msg.HTML_COLOUR,"[2]"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_IR_STRENGTH,"[1]"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_LIGHT_STRENGTH,"[0]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},HE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.HTML_COLOUR+ut.Msg.MSG.catSensor+" UCS12071").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET+"RGB"+ut.Msg.HTML_COLOUR,"0"],[ut.Msg.MIXLY_GET+ut.Msg.MIXLY_RGB_RAW,"1"],[ut.Msg.MIXLY_GET_ENV_LIGHT+ut.Msg.MIXLY_BRIGHTNESS,"2"],[ut.Msg.GET_IR_STRENGTH+ut.Msg.MIXLY_BRIGHTNESS,"3"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},WE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_EXTERN_LIGHTUV+" LTR390UV").setCheck("var"),this.appendDummyInput().appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GET_ENV_LIGHT,"E"],[ut.Msg.MIXLY_GET_ULTRAVIOLET,"U"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},KE={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_LASER_RANGE+" VL53L0X"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GET_DISTANCE+"(mm)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},JE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_TEM_HUM+" SHTC3").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},QE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_TEM_HUM+" AHT21").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETTEMPERATUE,"temperature"],[ut.Msg.MIXLY_GETHUMIDITY,"humidity"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{temperature:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,relative_humidity:ut.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},qE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_Altitude+ut.Msg.MSG.catSensor+" HP203X").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETPRESSURE,"pressure()"],[ut.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ut.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},zE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_Altitude+ut.Msg.MSG.catSensor+" SPL06_001").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_GETPRESSURE,"pressure()"],[ut.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[ut.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},jE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MIXGOPE_FIELD+ut.Msg.MSG.catSensor+" QMC5883L").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"get_bearing()"],[ut.Msg.MIXLY_TEMPERATURE,"get_temp()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},ZE={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_shake,"shake"],[ut.Msg.MIXLY_UP,"up"],[ut.Msg.MIXLY_DOWN,"down"],[ut.Msg.MIXLY_LEFT,"left"],[ut.Msg.MIXLY_RIGHT,"right"],[ut.Msg.MIXLY_MICROBIT_face_up,"face up"],[ut.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=ut.Msg.MIXLY_MICROBIT_JS_CURRENT,n=ut.Msg.MSG.catSensor,s=ut.Msg.MIXLY_MICROBIT_JS_STATE,o=ut.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:ut.Msg.MIXLY_MICROBIT_shake,up:ut.Msg.MIXLY_UP,down:ut.Msg.MIXLY_DOWN,left:ut.Msg.MIXLY_LEFT,right:ut.Msg.MIXLY_RIGHT,"face up":ut.Msg.MIXLY_MICROBIT_face_up,"face down":ut.Msg.MIXLY_MICROBIT_face_down}[e]+o}))}},$E={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},tO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_GET+ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},eO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+ut.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new ut.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=ut.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=ut.Msg.MIXLY_MICROBIT_Direction,s=ut.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":ut.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},iO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},nO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_GETTEMPERATUE)}},sO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return ut.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:ut.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:ut.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},oO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(ut.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ut.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},_O={init:function(){this.setColour(CE),this.appendValueInput("SPISUB").appendField(ut.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ut.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SETUP+ut.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new ut.FieldDropdown([["RFID","RFID"],["WS-LoRa","Weather"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("RFID","key")}},pO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RFID_READ_CARD_UID,"id"],[ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"content"],[ut.Msg.MIXLY_ALL,"ALL"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},aO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},uO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"+ut.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},rO={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ut.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},lO={init:function(){this.setColour(CE),this.appendDummyInput().appendField(ut.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("SECTOR").appendField(ut.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(ut.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(ut.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},dO={init:function(){this.setColour(CE),this.appendDummyInput().appendField("RFID"),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput("").appendField(new ut.FieldDropdown([[ut.Msg.MIXLY_RFID_SCAN_OK,"0"],[ut.Msg.MIXLY_RFID_SCAN_NOTAGERR,"1"],[ut.Msg.MIXLY_RFID_SCAN_ERROR,"2"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},IO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ut.FieldDropdown([["全部(元组)","data()[0]"],["全部(json)","data()[1]"],["全部(json,附带位置信息)","data()[2]"],["编号","data()[0][0]"],["电量","data()[0][1]"],["风速","data()[0][2]"],["阵风","data()[0][3]"],["风向","data()[0][4]"],["雨量","data()[0][5]"],["温度","data()[0][6]"],["湿度","data()[0][7]"],["光照","data()[0][8]"],["紫外线","data()[0][9]"],["大气压","data()[0][10]"],["信号强度","data()[0][11]"],["信噪比","data()[0][12]"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("返回气象数据元组 data= (设备id,电池状态,风速m/s,阵风m/s,风向°,雨量mm,温度℃,湿度%,光照Lux,UVI,大气压Pa,信号强度dB,信噪比dB)")}},TO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendDummyInput("").appendField(ut.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},hO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.appendValueInput("BASE").appendField("以主题"),this.appendDummyInput("").appendField("串口发送至MixIO"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},MO={init:function(){this.setColour(CE),this.appendValueInput("SUB").appendField("无线气象站 WS-LoRa").setCheck("var"),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ut.icons.MutatorIcon(["weather_set_label_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("weather_set_label_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n>6),i.push(128|63&o)):(2048<=o&&o<=55295||57344<=o&&o<=65535)&&(n+=3,i.push(224|15&o>>12),i.push(128|63&o>>6),i.push(128|63&o))}for(s=0;s>8,255&n].concat(i)}(t,!0),i="",n=0;n=0?"0x700000":["mixgo_zero"].indexOf(n)>=0?"0xE00000":"0x3A0000","32x12 Matrix"==_?(e.definitions_.import_matrix32x12="import matrix32x12",i=s+" = matrix32x12.Matrix("+o+",font_address="+p+")\n"):"16x8 Matrix"==_&&(e.definitions_.import_matrix16x8="import matrix16x8",i=s+" = matrix16x8.Matrix("+o+")\n"),i},nN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},sN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},oN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},_N=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},pN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},aN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},uN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},rN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},lN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},dN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},IN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".get_brightness()",e.ORDER_ATOMIC]},TN=function(t,e){return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},hN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("image"),e.ORDER_ATOMIC]},MN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_"+t.getFieldValue("OP")+"("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+","+e.valueToCode(t,"B",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},mN=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".map_invert("+e.valueToCode(t,"A",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},EN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+","+e.valueToCode(this,"column",e.ORDER_ATOMIC)+","+i+")\n"},ON=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+","+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},RN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},cN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),_=e.valueToCode(this,"height",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP");switch(p){case"True":return i+".show_fill_rect("+n+", "+s+", "+o+", "+_+","+a+")\n";case"False":return i+".show_rect("+n+", "+s+", "+o+", "+_+","+a+")\n"}},gN=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},CN=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},SN=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},AN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},LN=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},NN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),_="TRUE"==this.getFieldValue("fill")?"True":"False",p=this.getFieldValue("OP");switch(_){case"True":return i+".show_fill_circle("+n+", "+s+", "+o+", "+p+")\n";case"False":return i+".show_circle("+n+", "+s+", "+o+", "+p+")\n"}},DN=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),_=e.valueToCode(this,"y1",e.ORDER_ATOMIC),p=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",r=this.getFieldValue("OP");switch(u){case"True":return i+".show_fill_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n";case"False":return i+".show_triangle("+n+", "+s+", "+o+", "+_+", "+p+", "+a+", "+r+")\n"}},fN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},FN=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},PN=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},vN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+this.getFieldValue("STAT")+"()\n"},YN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".shownum("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},XN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".showDP("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},xN=function(t,e){return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".intensity("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},bN=function(t,e){e.definitions_.import_st7789="import st7789";var i=rt.Boards.getSelectedBoardKey().split(":")[2],n="";n=["mpython","mixgo_pe","mixgo_nova"].indexOf(i)>=0?"0x700000":["mixgo_zero"].indexOf(i)>=0?"0xE00000":"0x3A0000";var s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),o=e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC),_=e.valueToCode(this,"PINCS",e.ORDER_ATOMIC),p=e.valueToCode(this,"PINDC",e.ORDER_ATOMIC);return s+" = st7789.ST7789("+o+","+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+","+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+",dc_pin="+p+",cs_pin="+_+",rotation="+this.getFieldValue("rotate")+",font_address="+n+")\n"},yN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".image("+n+",x = "+s+",y = "+o+",size = "+_+",color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},VN=function(t,e){var i="0x"+this.getFieldValue("COLOR").slice(1);return["0x"+((16252928&i)>>8|(64512&i)>>5|(255&i)>>3).toString(16),e.ORDER_ATOMIC]},BN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),u=this.getFieldValue("center");if("0x"==a.slice(0,2))var r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color="+a+")\n";else{const t=a.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r=i+".shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+u+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},GN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p=i+".frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p=i+".frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},UN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u=i+".scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},wN=function(t,e){return e.definitions_.import_st7789="import st7789",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".fill(st7789."+this.getFieldValue("key")+")\n"},kN=function(t,e){e.definitions_.import_st7789="import st7789";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"x1",e.ORDER_ATOMIC),s=e.valueToCode(this,"y1",e.ORDER_ATOMIC),o=e.valueToCode(this,"x2",e.ORDER_ATOMIC),_=e.valueToCode(this,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=i+".line("+n+", "+s+", "+o+", "+_+", color="+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=i+".line("+n+", "+s+", "+o+", "+_+", color=0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},HN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=this.getFieldValue("key"),o=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return e.definitions_.import_i2clcd="import i2clcd",i+" = i2clcd.LCD("+n+",lcd_width="+s+",i2c_addr="+o+")\n"},WN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},KN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".print("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",column = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",line = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",delay="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},JN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".backlight("+this.getFieldValue("key")+")\n"},QN=function(t,e){return e.definitions_.import_i2clcd="import i2clcd",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".clear()\n"},qN=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC),o=rt.Boards.getSelectedBoardKey().split(":")[2],_="";return _=["mpython","mixgo_pe","mixgo_nova"].indexOf(o)>=0?"0x700000":["mixgo_zero"].indexOf(o)>=0?"0xE00000":"0x3A0000",e.definitions_.import_oled128x64="import oled128x64",i+" = oled128x64.OLED("+n+",address="+s+",font_address="+_+")\n"},zN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},jN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".image("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+")\n"},ZN=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$N=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",x = "+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+",center = "+this.getFieldValue("center")+")\n"},tD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},eD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},iD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},nD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",y = "+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+",size = "+e.valueToCode(this,"size",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},sD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".fill(0)\n"+i+".show()\n"},oD=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},_D=function(t,e){return e.definitions_.import_oled128x64="import oled128x64",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},pD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"+i+".show()\n"},aD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=t.getFieldValue("state");return i+"."+t.getFieldValue("shape")+"("+n+", "+s+", "+o+", "+_+", "+p+")\n"+i+".show()\n"},uD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=t.getFieldValue("state");return i+"."+("0"==t.getFieldValue("dir_h_v")?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\n"+i+".show()\n"},rD=function(t,e){e.definitions_.import_oled128x64="import oled128x64";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return i+".line("+e.valueToCode(t,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(t,"y2",e.ORDER_ATOMIC)+", "+t.getFieldValue("state")+")\n"+i+".show()\n"},lD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},dD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),o=this.getFieldValue("center");return"mixgo_zero"==i||"mixgo_nova"==i?(e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.shows("+n+",space = "+s+",center = "+o+")\n"):(e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.shows("+n+",space = "+s+",center = "+o+")\n")},ID=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},TD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",delay = "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},hD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_oled";var n="onboard_oled.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}else{e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix";n="onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"}return n},MD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",speed ="+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+",space = "+e.valueToCode(this,"space",e.ORDER_ASSIGNMENT)+")\n"},mD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},ED=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix",["onboard_matrix."+t.getFieldValue("image"),e.ORDER_ATOMIC]},OD=function(t,e){var i={"#000000":"0","#ff0000":"1"};function n(t){let e="";if(t.length%2==1&&(t="0"+t),t.length<8){let e=8-t.length;for(let i=1;i<=e;i++)t="0"+t}for(let i=1;i<=t.length;i++)i%2==0&&i!==t.length?e=e+t[i-1]+",0x":e+=t[i-1];return"0x"+e}let s=[];for(let e=0;e<12;e++){let o="",_=0,p=0;for(let n=0;n<32;n++)n<8?p=7-n:n<16?p=23-n:n<24?p=39-n:n<32&&(p=55-n),_+=Number(i[t.getFieldValue(e+"-"+n)])*Math.pow(2,31-p);o+=n(_.toString(16)),s.unshift(o)}let o=[];for(let t=0;t>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},jD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=this.getFieldValue("center"),u=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==u.slice(0,2))var r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color="+u+")\n";else{const t=u.match(/\d+/g);var l="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");r="onboard_tft.shows("+n+",x = "+s+",y = "+o+",size = "+_+",space = "+p+",center = "+a+",color=0x"+((16252928&l)>>8|(64512&l)>>5|(255&l)>>3).toString(16)+")\n"}return r},ZD=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.frame("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},$D=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==_.slice(0,2))var p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color="+_+")\n";else{const t=_.match(/\d+/g);var a="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");p="onboard_tft.frame("+n+",size = "+s+",delay = "+o+",color=0x"+((16252928&a)>>8|(64512&a)>>5|(255&a)>>3).toString(16)+")\n"}return p},tf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_oled"]="from "+i+" import onboard_tft","onboard_tft.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+",color=0xffff)\n"},ef=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"time",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"space",e.ORDER_ASSIGNMENT),a=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==a.slice(0,2))var u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color="+a+")\n";else{const t=a.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft.scroll("+n+",y = "+s+",size = "+o+",speed ="+_+",space = "+p+",color=0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\n"}return u},nf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"w",e.ORDER_ATOMIC),_=e.valueToCode(t,"h",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),a=t.getFieldValue("shape");if("0x"==p.slice(0,2))var u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var r="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");u="onboard_tft."+a+"("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&r)>>8|(64512&r)>>5|(255&r)>>3).toString(16)+")\nonboard_tft.show()\n"}return u},sf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"length",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("dir_h_v");if("0x"==_.slice(0,2))var a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", "+_+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft."+("0"==p?"v":"h")+"line("+n+", "+s+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},of=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x1",e.ORDER_ATOMIC),s=e.valueToCode(t,"y1",e.ORDER_ATOMIC),o=e.valueToCode(t,"x2",e.ORDER_ATOMIC),_=e.valueToCode(t,"y2",e.ORDER_ATOMIC),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", "+p+")\nonboard_tft.show()\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.line("+n+", "+s+", "+o+", "+_+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\nonboard_tft.show()\n"}return a},_f=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return"onboard_tft.fill(0)\nonboard_tft.show()\n"},pf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft."+t.getFieldValue("OP")+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")\n"},af=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft",["hex(onboard_tft.pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+")))",e.ORDER_ATOMIC]},uf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==o.slice(0,2))var _="onboard_tft.pixel(int("+n+"), int("+s+"), "+o+")\nonboard_tft.show()\n";else{const t=o.match(/\d+/g);var p="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");_="onboard_tft.pixel(int("+n+"), int("+s+"), 0x"+((16252928&p)>>8|(64512&p)>>5|(255&p)>>3).toString(16)+")\nonboard_tft.show()\n"}return _},rf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";return["onboard_tft.get_brightness()",e.ORDER_ATOMIC]},lf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft","onboard_tft.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},df=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT);if("0x"==n.slice(0,2))var s="onboard_tft.fill("+n+")\nonboard_tft.show()\n";else{const t=n.match(/\d+/g);var o="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");s="onboard_tft.fill(0x"+((16252928&o)>>8|(64512&o)>>5|(255&o)>>3).toString(16)+")\nonboard_tft.show()\n"}return s},If=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"x",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"y",e.ORDER_ASSIGNMENT),o=e.valueToCode(this,"size",e.ORDER_ASSIGNMENT),_=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),p=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==p.slice(0,2))var a=_+"=Clock("+n+","+s+","+o+","+p+")\n";else{const t=p.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a=_+"=Clock("+n+","+s+","+o+",0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+")\n"}return a},Tf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_rtctime()\n"},hf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".set_time("+e.valueToCode(this,"h",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"m",e.ORDER_ASSIGNMENT)+","+e.valueToCode(this,"s",e.ORDER_ASSIGNMENT)+")\n"},Mf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock",e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)+".draw_clock()\n"},mf=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_Clock"]="from "+i+" import Clock";var n=e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT),s=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);if("0x"==s.slice(0,2))var o=n+".clear("+s+")\n";else{const t=s.match(/\d+/g);var _="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");o=n+".clear(0x"+((16252928&_)>>8|(64512&_)>>5|(255&_)>>3).toString(16)+")\n"}return o},Ef=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_tft"]="from "+i+" import onboard_tft";var n=e.valueToCode(t,"x",e.ORDER_ATOMIC),s=e.valueToCode(t,"y",e.ORDER_ATOMIC),o=e.valueToCode(t,"r",e.ORDER_ATOMIC),_=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),p=t.getFieldValue("shape");if("0x"==_.slice(0,2))var a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", "+_+","+p+")\nonboard_tft.show()\n";else{const t=_.match(/\d+/g);var u="0x"+((parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).padStart(4,"0");a="onboard_tft.ellipse("+n+", "+s+", "+o+", "+o+", 0x"+((16252928&u)>>8|(64512&u)>>5|(255&u)>>3).toString(16)+","+p+")\nonboard_tft.show()\n"}return a},Of=function(t,e){var i=rt.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_matrix"]="from "+i+" import onboard_matrix","onboard_matrix.pointern(angle="+e.valueToCode(this,"angle",e.ORDER_ASSIGNMENT)+")\n"},Rf=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},cf=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},gf=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s {\n"+e.statementToCode(this,"do")+"})\n"},mX=function(){return"control.reset()\n"},EX=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||rt.Profile.default.serial)+")\n"},OX=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||rt.Profile.default.serial)+")\n"},RX=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||rt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},cX=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},gX=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},CX=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},SX=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},AX=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},LX=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},NX=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},DX=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},fX=function(){return"while True:\n pass\n"},FX=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},PX=function(t,e){return e.definitions_.import_os="import os","os.uname()"},vX=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},YX=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},XX=function(t,e){return e.definitions_.import_mixgo="import mixgo",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = Timer."+(e.valueToCode(this,"mode",e.ORDER_NONE)||"None")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},xX=function(t,e){return e.definitions_.import_machine="import machine",(e.valueToCode(this,"VAR",e.ORDER_NONE)||"None")+".init(period = "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+", mode = machine.Timer."+this.getFieldValue("mode")+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},bX=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},yX=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",i+" = machine.Timer(0)\n"},VX=function(t,e){return e.definitions_.import_machine="import machine","wdt = machine.WDT(timeout= "+(e.valueToCode(this,"period",e.ORDER_NONE)||"0")+")\n"},BX=function(t,e){e.definitions_.import_machine="import machine";return"wdt.feed()\n"},GX=function(t,e){e.definitions_.import_machine="import machine";return"machine.reset()\n"},UX=function(t,e){e.definitions_.import_bitbot_onboard_bot51="from bitbot import onboard_bot51";return"onboard_bot51.shutdown()\n"},wX=yX,kX=xX,HX=bX,WX=vX,KX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},JX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api."+this.getFieldValue("mode")+"("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},QX=function(t,e){return e.definitions_.import_seniverse_api="import seniverse_api",["seniverse_api.weather_hourly("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"hour",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},qX=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")\n"},zX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_now.analysis()";else n='Weather_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},jX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Air_now.analysis()";else n='Air_now.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ZX=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Weather_alarm.analysis()";else n='Weather_alarm.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},$X=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Life_suggestion.analysis()";else n='Life_suggestion.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},tx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Tide_daily.analysis()";else n='Tide_daily.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ex=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content");if("none"==i)var n="Location_search.analysis()";else n='Location_search.analysis("'+i+'")';return[n,e.ORDER_ATOMIC]},ix=function(t,e){return e.definitions_["import_seniverse_api*"]="from seniverse_api import *",this.getFieldValue("mode")+".request("+e.valueToCode(this,"key",e.ORDER_ATOMIC)+","+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+","+e.valueToCode(this,"day",e.ORDER_ATOMIC)+")\n"},nx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Weather_daily.analysis("+n+")";else s="Weather_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},sx=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Air_daily.analysis("+n+")";else s="Air_daily.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},ox=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_sun.analysis("+n+")";else s="Geo_sun.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},_x=function(t,e){e.definitions_["import_seniverse_api*"]="from seniverse_api import *";var i=this.getFieldValue("content"),n=e.valueToCode(this,"day",e.ORDER_ATOMIC);if("none"==i)var s="Geo_moon.analysis("+n+")";else s="Geo_moon.analysis("+n+',"'+i+'")';return[s,e.ORDER_ATOMIC]},px={};px["飞乙"]={description:"MicroPython[ESP32C3 Bitbot]",digital_pin:rt.Profile.generate(["0-11","18-21"]),input_pin:rt.Profile.generate(["0-11","18-21"]),output_pin:rt.Profile.generate(["0-11","18-21"]),pwm_input:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_input:rt.Profile.generate(["0-5"],"adc","adc"),pwm_output:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_output:rt.Profile.generate(["0-5"],"adc","adc"),espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),digital:rt.Profile.generate(["0-11","18-21"],"pin","pin"),pwm_pin:rt.Profile.generate(["0-11","18-21"]),pwm:rt.Profile.generate(["0-11","18-21"],"pwm","pwm"),analog_pin:rt.Profile.generate(["0-5"]),analog:rt.Profile.generate(["0-5"],"adc","adc"),button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]],extern_addr:rt.Profile.generate(["0-1"]),als_num:rt.Profile.generate(["0-3"])},px["超霸大师"]={description:"MicroPython[ESP32 Mixbot]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["P","button_p"],["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["MUSIC_QUAVERS","onboard_matrix.MUSIC_QUAVERS"],["MUSIC_QUAVER","onboard_matrix.MUSIC_QUAVER"],["MUSIC_CROTCHET","onboard_matrix.MUSIC_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]],extern_addr:rt.Profile.generate(["0-3"])},px["ESP32 Generic"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin6","pin6"],["pin7","pin7"],["pin8","pin8"],["pin9","pin9"],["pin10","pin10"],["pin11","pin11"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["7","7"],["8","8"],["12","12"],["13","13"],["14","14"],["15","15"],["19","19"],["20","20"],["21","21"],["22","22"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]},px["机器人大师"]={description:"MicroPython[ESP32 Generic]",digital_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],digital:[["pin0","pin0"],["pin2","pin2"],["pin4","pin4"],["pin5","pin5"],["pin12","pin12"],["pin13","pin13"],["pin14","pin14"],["pin15","pin15"],["pin16","pin16"],["pin17","pin17"],["pin18","pin18"],["pin19","pin19"],["pin20","pin20"],["pin21","pin21"],["pin22","pin22"],["pin23","pin23"],["pin25","pin25"],["pin26","pin26"],["pin27","pin27"],["pin32","pin32"],["pin33","pin33"],["pin34","pin34"],["pin35","pin35"],["pin36","pin36"],["pin37","pin37"],["pin38","pin38"],["pin39","pin39"]],input_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],output_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["18","18"],["19","19"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"],["33","33"]],pwm_pin:[["0","0"],["2","2"],["4","4"],["5","5"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["25","25"],["26","26"],["27","27"],["32","32"]],pwm:[["pwm0","pwm0"],["pwm2","pwm2"],["pwm4","pwm4"],["pwm5","pwm5"],["pwm12","pwm12"],["pwm13","pwm13"],["pwm14","pwm14"],["pwm15","pwm15"],["pwm16","pwm16"],["pwm17","pwm17"],["pwm18","pwm18"],["pwm19","pwm19"],["pwm20","pwm20"],["pwm21","pwm21"],["pwm22","pwm22"],["pwm23","pwm23"],["pwm25","pwm25"],["pwm26","pwm26"],["pwm27","pwm27"],["pwm32","pwm32"]],espnow_channel:rt.Profile.generate(["1-13"]),haskylens_model:rt.Profile.generate(["0-4"]),analog_pin:[["32","32"],["33","33"],["34","34"],["35","35"],["36","36"],["37","37"],["38","38"],["39","39"]],analog:[["adc32","adc32"],["adc33","adc33"],["adc34","adc34"],["adc35","adc35"],["adc36","adc36"],["adc37","adc37"],["adc38","adc38"],["adc39","adc39"]],dac_pin:[["25","25"],["26","26"]],dac:[["dac25","dac25"],["dac26","dac26"]],touch:[["tc0","tc0"],["tc2","tc2"],["tc4","tc4"],["tc12","tc12"],["tc13","tc13"],["tc14","tc14"],["tc15","tc15"],["tc27","tc27"],["tc32","tc32"],["tc33","tc33"]],touch_pin:[["0","0"],["2","2"],["4","4"],["12","12"],["13","13"],["14","14"],["15","15"],["27","27"],["32","32"],["33","33"]],button:[["p","button_p"],["cw","button_cw"],["ccw","button_ccw"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],brightness:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]],tts_voice:rt.Profile.generate(["0-16"]),tts_builtin_music:rt.Profile.generate(["0-47"]),tts_bgmusic:rt.Profile.generate(["0-15"]),builtinimg:[["HEART","onboard_matrix.HEART"],["HEART_SMALL","onboard_matrix.HEART_SMALL"],["HAPPY","onboard_matrix.HAPPY"],["SAD","onboard_matrix.SAD"],["SMILE","onboard_matrix.SMILE"],["SILLY","onboard_matrix.SILLY"],["FABULOUS","onboard_matrix.FABULOUS"],["SURPRISED","onboard_matrix.SURPRISED"],["ASLEEP","onboard_matrix.ASLEEP"],["ANGRY","onboard_matrix.ANGRY"],["CONFUSED","onboard_matrix.CONFUSED"],["NO","onboard_matrix.NO"],["YES","onboard_matrix.YES"],["LEFT_ARROW","onboard_matrix.LEFT_ARROW"],["RIGHT_ARROW","onboard_matrix.RIGHT_ARROW"],["DRESS","onboard_matrix.DRESS"],["TRANSFORMERS","onboard_matrix.TRANSFORMERS"],["SCISSORS","onboard_matrix.SCISSORS"],["EXIT","onboard_matrix.EXIT"],["TREE","onboard_matrix.TREE"],["PACMAN","onboard_matrix.PACMAN"],["TARGET","onboard_matrix.TARGET"],["TSHIRT","onboard_matrix.TSHIRT"],["ROLLERSKATE","onboard_matrix.ROLLERSKATE"],["DUCK","onboard_matrix.DUCK"],["HOUSE","onboard_matrix.HOUSE"],["TORTOISE","onboard_matrix.TORTOISE"],["BUTTERFLY","onboard_matrix.BUTTERFLY"],["STICKFIGURE","onboard_matrix.STICKFIGURE"],["GHOST","onboard_matrix.GHOST"],["PITCHFORK","onboard_matrix.PITCHFORK"],["onboard_music_QUAVERS","onboard_matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","onboard_matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","onboard_matrix.onboard_music_CROTCHET"],["COW","onboard_matrix.COW"],["RABBIT","onboard_matrix.RABBIT"],["SQUARE_SMALL","onboard_matrix.SQUARE_SMALL"],["SQUARE","onboard_matrix.SQUARE"],["DIAMOND_SMALL","onboard_matrix.DIAMOND_SMALL"],["DIAMOND","onboard_matrix.DIAMOND"],["CHESSBOARD","onboard_matrix.CHESSBOARD"],["TRIANGLE_LEFT","onboard_matrix.TRIANGLE_LEFT"],["TRIANGLE","onboard_matrix.TRIANGLE"],["SNAKE","onboard_matrix.SNAKE"],["UMBRELLA","onboard_matrix.UMBRELLA"],["SKULL","onboard_matrix.SKULL"],["GIRAFFE","onboard_matrix.GIRAFFE"],["SWORD","onboard_matrix.SWORD"]],builtinimg_extern:[["HEART","matrix32x12.Matrix.HEART"],["HEART_SMALL","matrix32x12.Matrix.HEART_SMALL"],["HAPPY","matrix32x12.Matrix.HAPPY"],["SAD","matrix32x12.Matrix.SAD"],["SMILE","matrix32x12.Matrix.SMILE"],["SILLY","matrix32x12.Matrix.SILLY"],["FABULOUS","matrix32x12.Matrix.FABULOUS"],["SURPRISED","matrix32x12.Matrix.SURPRISED"],["ASLEEP","matrix32x12.Matrix.ASLEEP"],["ANGRY","matrix32x12.Matrix.ANGRY"],["CONFUSED","matrix32x12.Matrix.CONFUSED"],["NO","matrix32x12.Matrix.NO"],["YES","matrix32x12.Matrix.YES"],["LEFT_ARROW","matrix32x12.Matrix.LEFT_ARROW"],["RIGHT_ARROW","matrix32x12.Matrix.RIGHT_ARROW"],["DRESS","matrix32x12.Matrix.DRESS"],["TRANSFORMERS","matrix32x12.Matrix.TRANSFORMERS"],["SCISSORS","matrix32x12.Matrix.SCISSORS"],["EXIT","matrix32x12.Matrix.EXIT"],["TREE","matrix32x12.Matrix.TREE"],["PACMAN","matrix32x12.Matrix.PACMAN"],["TARGET","matrix32x12.Matrix.TARGET"],["TSHIRT","matrix32x12.Matrix.TSHIRT"],["ROLLERSKATE","matrix32x12.Matrix.ROLLERSKATE"],["DUCK","matrix32x12.Matrix.DUCK"],["HOUSE","matrix32x12.Matrix.HOUSE"],["TORTOISE","matrix32x12.Matrix.TORTOISE"],["BUTTERFLY","matrix32x12.Matrix.BUTTERFLY"],["STICKFIGURE","matrix32x12.Matrix.STICKFIGURE"],["GHOST","matrix32x12.Matrix.GHOST"],["PITCHFORK","matrix32x12.Matrix.PITCHFORK"],["onboard_music_QUAVERS","matrix32x12.Matrix.onboard_music_QUAVERS"],["onboard_music_QUAVER","matrix32x12.Matrix.onboard_music_QUAVER"],["onboard_music_CROTCHET","matrix32x12.Matrix.onboard_music_CROTCHET"],["COW","matrix32x12.Matrix.COW"],["RABBIT","matrix32x12.Matrix.RABBIT"],["SQUARE_SMALL","matrix32x12.Matrix.SQUARE_SMALL"],["SQUARE","matrix32x12.Matrix.SQUARE"],["DIAMOND_SMALL","matrix32x12.Matrix.DIAMOND_SMALL"],["DIAMOND","matrix32x12.Matrix.DIAMOND"],["CHESSBOARD","matrix32x12.Matrix.CHESSBOARD"],["TRIANGLE_LEFT","matrix32x12.Matrix.TRIANGLE_LEFT"],["TRIANGLE","matrix32x12.Matrix.TRIANGLE"],["SNAKE","matrix32x12.Matrix.SNAKE"],["UMBRELLA","matrix32x12.Matrix.UMBRELLA"],["SKULL","matrix32x12.Matrix.SKULL"],["GIRAFFE","matrix32x12.Matrix.GIRAFFE"],["SWORD","matrix32x12.Matrix.SWORD"]],imglist:[["ALL_CLOCKS","onboard_matrix.ALL_CLOCKS"],["ALL_ARROWS","onboard_matrix.ALL_ARROWS"]],playlist:[["DADADADUM","onboard_music.DADADADUM"],["ENTERTAINER","onboard_music.ENTERTAINER"],["PRELUDE","onboard_music.PRELUDE"],["ODE","onboard_music.ODE"],["NYAN","onboard_music.NYAN"],["RINGTONE","onboard_music.RINGTONE"],["FUNK","onboard_music.FUNK"],["BLUES","onboard_music.BLUES"],["BIRTHDAY","onboard_music.BIRTHDAY"],["WEDDING","onboard_music.WEDDING"],["FUNERAL","onboard_music.FUNERAL"],["PUNCHLINE","onboard_music.PUNCHLINE"],["PYTHON","onboard_music.PYTHON"],["BADDY","onboard_music.BADDY"],["CHASE","onboard_music.CHASE"],["BA_DING","onboard_music.BA_DING"],["WAWAWAWAA","onboard_music.WAWAWAWAA"],["JUMP_UP","onboard_music.JUMP_UP"],["JUMP_DOWN","onboard_music.JUMP_DOWN"],["POWER_UP","onboard_music.POWER_UP"],["POWER_DOWN","onboard_music.POWER_DOWN"]],playlist_extern:[["DADADADUM","DADADADUM"],["ENTERTAINER","ENTERTAINER"],["PRELUDE","PRELUDE"],["ODE","ODE"],["NYAN","NYAN"],["RINGTONE","RINGTONE"],["FUNK","FUNK"],["BLUES","BLUES"],["BIRTHDAY","BIRTHDAY"],["WEDDING","WEDDING"],["FUNERAL","FUNERAL"],["PUNCHLINE","PUNCHLINE"],["PYTHON","PYTHON"],["BADDY","BADDY"],["CHASE","CHASE"],["BA_DING","BA_DING"],["WAWAWAWAA","WAWAWAWAA"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]],tone_notes:[["NOTE_C3","131"],["NOTE_D3","147"],["NOTE_E3","165"],["NOTE_F3","175"],["NOTE_G3","196"],["NOTE_A3","220"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"],["NOTE_A5","880"],["NOTE_B5","988"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]],digital_dot:[["0","0"],["1","1"],["2","2"],["3","3"]]};const ax=px,ux=230,rx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital),"PIN"),this.setOutput(!0)}},lx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},dx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.input_pin),"PIN"),this.setOutput(!0,Number)}},Ix={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.output_pin),"PIN"),this.setOutput(!0,Number)}},Tx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch_mpython),"PIN"),this.setOutput(!0,Number)}},hx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.espnow_channel),"PIN"),this.setOutput(!0,Number)}},Mx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.haskylens_model),"PIN"),this.setOutput(!0,Number)}},mx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_input),"PIN"),this.setOutput(!0)}},Ex={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_input),"PIN"),this.setOutput(!0)}},Ox={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_output),"PIN"),this.setOutput(!0)}},Rx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_output),"PIN"),this.setOutput(!0)}},cx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.i2c_A_pin),"PIN"),this.setOutput(!0,Number)}},gx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.i2c_B_pin),"PIN"),this.setOutput(!0,Number)}},Cx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_A_pin),"PIN"),this.setOutput(!0,Number)}},Sx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_B_pin),"PIN"),this.setOutput(!0,Number)}},Ax={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_C_pin),"PIN"),this.setOutput(!0,Number)}},Lx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.spi_D_pin),"PIN"),this.setOutput(!0,Number)}},Nx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog),"PIN"),this.setOutput(!0)}},Dx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},fx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.dac),"PIN"),this.setOutput(!0)}},Fx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},Px={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},vx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},Yx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},Xx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},xx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.touch),"PIN"),this.setOutput(!0)}},bx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},yx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},Vx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.builtinimg_extern),"PIN"),this.setOutput(!0,"esp32_image")}},Bx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},Gx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},Ux={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.playlist_extern),"PIN"),this.setOutput(!0)}},wx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},kx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},Hx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Wx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},Kx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_voice),"PIN"),this.setOutput(!0,Number)}},Jx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_builtin_music),"PIN"),this.setOutput(!0,Number)}},Qx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tts_bgmusic),"PIN"),this.setOutput(!0,Number)}},qx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},zx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},jx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Zx={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},$x={init:function(){this.setColour(ux),this.appendDummyInput("").appendField(new ut.FieldDropdown(rt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},tb=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},eb=tb,ib=tb,nb=tb,sb=tb,ob=tb,_b=tb,pb=tb,ab=tb,ub=tb,rb=tb,lb=tb,db=tb,Ib=tb,Tb=tb,hb=tb,Mb=tb,mb=tb,Eb=tb,Ob=tb,Rb=tb,cb=tb,gb=tb,Cb=tb,Sb=tb,Ab=tb,Lb=tb,Nb=tb,Db=tb,fb=tb,Fb=tb,Pb=tb,vb=tb,Yb=tb,Xb=tb;Object.assign(ut.Variables,dt),Object.assign(ut.Procedures,Wn),ut.Python=Iu,ut.generator=Iu,rt.Profile.default={},Object.assign(rt.Profile,ax),Object.assign(rt.Profile.default,ax["ESP32 Generic"]),Object.assign(ut.Blocks,e,i,n,s,o,_,p,a,u,r,l,d,I,b,w,U,v,y,k,f,G,B,V,F,D,N,X,Y,x,P,pt),Object.assign(ut.Python.forBlock,T,h,M,m,E,O,R,c,g,C,S,A,L,$,ot,st,q,tt,_t,K,nt,it,et,J,W,H,j,z,Z,Q,at)})(); \ No newline at end of file diff --git a/boards/default/python_mixpy/main.bundle.js b/boards/default/python_mixpy/main.bundle.js index 47bb29c8..0cf4472a 100644 --- a/boards/default/python_mixpy/main.bundle.js +++ b/boards/default/python_mixpy/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),a=0;a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},datetime_fromtimestamp={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"],[external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"bti"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,turn_to_int={init:function(){this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},generate_cartesian_product={init:function(){this.setColour(MATH_HUE),this.itemCount_=1,this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PRODUCT+external_Blockly_namespaceObject.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dicts_to_to={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,i=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+i}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,i=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+i}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+p()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():p(),e+="("+a+", "+_+", "+l+")");else{var r=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);s+=_+" = "+e+"\n",e=_}return e};a=r(a,"_start"),_=r(_,"_end");r(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):p(0,_):e(a,_,l)}return s+="for "+n+" in "+e+":\n"+i},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",i=t.statementToCode(e,"DO"),s=t.addLoopTrap(i,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+s},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,control_datetime_fromtimestamp=function(e,t){return t.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),i=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+i+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",i="10";if("two"==n?i="2":"eight"==n?i="8":"ten"==n?i="10":"sixteen"==n&&(i="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var s="int(str("+a+"), "+i+")";else s=l+"(int(str("+a+"), "+i+"))";return[s,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+a+',"big")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,math_turn_to_int=function(e,t){return t.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+").decode()",t.ORDER_ATOMIC]},math_generate_cartesian_product=function(e,t){t.definitions_.import_itertools="import itertools";let n=t.valueToCode(this,"REPEAT",t.ORDER_ATOMIC),a=new Array(this.itemCount_);for(let e=0;e",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var i=_+" and "+l;else if("OR"==n)i=_+" or "+l;else if("NOR"==n)i="not("+_+"^"+l+")";else i=_+"^"+l;return[i,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],i=0;i\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+i.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+i.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+s+" + "+_+")":_<0?"int("+s+" - "+-_+")":"int("+s+")",a&&(s="-"+s)),s};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},plot_cla={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},data_plot_cla=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),i=0;i0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},datetime_fromtimestamp={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"],[external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"bti"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,turn_to_int={init:function(){this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},generate_cartesian_product={init:function(){this.setColour(MATH_HUE),this.itemCount_=1,this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PRODUCT+external_Blockly_namespaceObject.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dicts_to_to={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,i=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+i}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,i=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+i}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+p()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():p(),e+="("+a+", "+_+", "+l+")");else{var r=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);s+=_+" = "+e+"\n",e=_}return e};a=r(a,"_start"),_=r(_,"_end");r(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):p(0,_):e(a,_,l)}return s+="for "+n+" in "+e+":\n"+i},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",i=t.statementToCode(e,"DO"),s=t.addLoopTrap(i,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+s},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,control_datetime_fromtimestamp=function(e,t){return t.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),i=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+i+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",i="10";if("two"==n?i="2":"eight"==n?i="8":"ten"==n?i="10":"sixteen"==n&&(i="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var s="int(str("+a+"), "+i+")";else s=l+"(int(str("+a+"), "+i+"))";return[s,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+a+',"big")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,math_turn_to_int=function(e,t){return t.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+").decode()",t.ORDER_ATOMIC]},math_generate_cartesian_product=function(e,t){t.definitions_.import_itertools="import itertools";let n=t.valueToCode(this,"REPEAT",t.ORDER_ATOMIC),a=new Array(this.itemCount_);for(let e=0;e",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var i=_+" and "+l;else if("OR"==n)i=_+" or "+l;else if("NOR"==n)i="not("+_+"^"+l+")";else i=_+"^"+l;return[i,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],i=0;i\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+i.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+i.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+s+" + "+_+")":_<0?"int("+s+" - "+-_+")":"int("+s+")",a&&(s="-"+s)),s};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},plot_cla={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},data_plot_cla=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),i=0;i{"use strict";var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}},9610:(e,t,n)=>{n.d(t,{D:()=>a});var a=function(){function e(e){var t=this;void 0===e&&(e=!1),this.ignoreMultipleSettles=e,this.isSettled=!1,this.promise=new Promise((function(e,n){t.resolveCallback=e,t.rejectCallback=n}))}return e.prototype.markAsSettled=function(){var e=this.isSettled;if(e&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!e},Object.defineProperty(e.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this.markAsSettled()&&this.resolveCallback(e)},e.prototype.reject=function(e){this.markAsSettled()&&this.rejectCallback(e)},e}()},6944:e=>{e.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var a={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var _=2&t&&e;"object"==typeof _&&!~leafPrototypes.indexOf(_);_=getProto(_))Object.getOwnPropertyNames(_).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,__webpack_require__.d(n,a),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".bundle.js",__webpack_require__.miniCssF=e=>"styles/"+e+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,a)=>{if(inProgress[e])inProgress[e].push(t);else{var _,l;if(void 0!==n)for(var s=document.getElementsByTagName("script"),i=0;i{_.onerror=_.onload=null,clearTimeout(p);var a=inProgress[e];if(delete inProgress[e],_.parentNode&&_.parentNode.removeChild(_),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(r.bind(null,void 0,{type:"timeout",target:_}),12e4);_.onerror=r.bind(null,_.onerror),_.onload=r.bind(null,_.onload),l&&document.head.appendChild(_)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,n)=>{var a=__webpack_require__.miniCssF(e),_=__webpack_require__.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),a=0;a{var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",__webpack_require__.nc&&(l.nonce=__webpack_require__.nc),l.onerror=l.onload=n=>{if(l.onerror=l.onload=null,"load"===n.type)a();else{var s=n&&n.type,i=n&&n.target&&n.target.href||t,o=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+i+")");o.name="ChunkLoadError",o.code="CSS_CHUNK_LOAD_FAILED",o.type=s,o.request=i,l.parentNode&&l.parentNode.removeChild(l),_(o)}},l.href=t,n?n.parentNode.insertBefore(l,n.nextSibling):document.head.appendChild(l)})(e,_,null,t,n)})),t={792:0};__webpack_require__.f.miniCss=(n,a)=>{t[n]?a.push(t[n]):0!==t[n]&&{317:1}[n]&&a.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var a=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var _=new Promise(((n,_)=>a=e[t]=[n,_]));n.push(a[2]=_);var l=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(l,(n=>{if(__webpack_require__.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var _=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+_+": "+l+")",s.name="ChunkLoadError",s.type=_,s.request=l,a[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var a,_,[l,s,i]=n,o=0;if(l.some((t=>0!==e[t]))){for(a in s)__webpack_require__.o(s,a)&&(__webpack_require__.m[a]=s[a]);if(i)i(__webpack_require__)}for(t&&t(n);ocontrols_type,controls_typeLists:()=>controls_typeLists,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item,unpack_iterable_object:()=>unpack_iterable_object,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,datetime_fromtimestamp:()=>datetime_fromtimestamp,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free,get_unique_identifier:()=>get_unique_identifier});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,generate_cartesian_product:()=>generate_cartesian_product,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt,turn_to_int:()=>turn_to_int});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{ENUMERATE:()=>ENUMERATE,enumerate:()=>enumerate,list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_to_to:()=>dicts_to_to,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,lists_zip:()=>variables_lists_zip,unpack_iterable_object:()=>variables_unpack_iterable_object,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,datetime_fromtimestamp:()=>control_datetime_fromtimestamp,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,get_unique_identifier:()=>control_get_unique_identifier,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,generate_cartesian_product:()=>math_generate_cartesian_product,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt,turn_to_int:()=>math_turn_to_int});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{enumerate:()=>lists_enumerate,list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_to_to:()=>dicts_dicts_to_to,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_aggregate_func:()=>dataframe_aggregate_func,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_groupby:()=>dataframe_groupby,dataframe_head_tail:()=>dataframe_head_tail,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,dataframe_select:()=>dataframe_select,dataframe_sort_values:()=>dataframe_sort_values,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_cla:()=>plot_cla,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_aggregate_func:()=>data_dataframe_aggregate_func,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_groupby:()=>data_dataframe_groupby,dataframe_head_tail:()=>data_dataframe_head_tail,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,dataframe_select:()=>data_dataframe_select,dataframe_sort_values:()=>data_dataframe_sort_values,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_cla:()=>data_plot_cla,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,ZhHansMsg={PYTHON_PYODIDE_IMAGE:"图像"},ZhHansCatgories={},ZhHantMsg={PYTHON_PYODIDE_IMAGE:"影像"},ZhHantCatgories={},EnMsg={PYTHON_PYODIDE_IMAGE:"Image"},EnCatgories={};Object.assign(external_Blockly_namespaceObject.Lang.ZhHans,ZhHansMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant,ZhHantMsg),Object.assign(external_Blockly_namespaceObject.Lang.En,EnMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHans.MSG,ZhHansCatgories),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant.MSG,ZhHantCatgories),Object.assign(external_Blockly_namespaceObject.Lang.En.MSG,EnCatgories);const external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),a=0;a1&&(s+=a)):n=s}else n="i";return n}},variables=Variables; +(()=>{"use strict";var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}},9610:(e,t,n)=>{n.d(t,{D:()=>a});var a=function(){function e(e){var t=this;void 0===e&&(e=!1),this.ignoreMultipleSettles=e,this.isSettled=!1,this.promise=new Promise((function(e,n){t.resolveCallback=e,t.rejectCallback=n}))}return e.prototype.markAsSettled=function(){var e=this.isSettled;if(e&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!e},Object.defineProperty(e.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this.markAsSettled()&&this.resolveCallback(e)},e.prototype.reject=function(e){this.markAsSettled()&&this.rejectCallback(e)},e}()},6944:e=>{e.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var a={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var _=2&t&&e;"object"==typeof _&&!~leafPrototypes.indexOf(_);_=getProto(_))Object.getOwnPropertyNames(_).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,__webpack_require__.d(n,a),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".bundle.js",__webpack_require__.miniCssF=e=>"styles/"+e+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,a)=>{if(inProgress[e])inProgress[e].push(t);else{var _,l;if(void 0!==n)for(var s=document.getElementsByTagName("script"),i=0;i{_.onerror=_.onload=null,clearTimeout(p);var a=inProgress[e];if(delete inProgress[e],_.parentNode&&_.parentNode.removeChild(_),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(r.bind(null,void 0,{type:"timeout",target:_}),12e4);_.onerror=r.bind(null,_.onerror),_.onload=r.bind(null,_.onload),l&&document.head.appendChild(_)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,n)=>{var a=__webpack_require__.miniCssF(e),_=__webpack_require__.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),a=0;a{var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",__webpack_require__.nc&&(l.nonce=__webpack_require__.nc),l.onerror=l.onload=n=>{if(l.onerror=l.onload=null,"load"===n.type)a();else{var s=n&&n.type,i=n&&n.target&&n.target.href||t,o=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+i+")");o.name="ChunkLoadError",o.code="CSS_CHUNK_LOAD_FAILED",o.type=s,o.request=i,l.parentNode&&l.parentNode.removeChild(l),_(o)}},l.href=t,n?n.parentNode.insertBefore(l,n.nextSibling):document.head.appendChild(l)})(e,_,null,t,n)})),t={792:0};__webpack_require__.f.miniCss=(n,a)=>{t[n]?a.push(t[n]):0!==t[n]&&{317:1}[n]&&a.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var a=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var _=new Promise(((n,_)=>a=e[t]=[n,_]));n.push(a[2]=_);var l=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(l,(n=>{if(__webpack_require__.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var _=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+_+": "+l+")",s.name="ChunkLoadError",s.type=_,s.request=l,a[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var a,_,[l,s,i]=n,o=0;if(l.some((t=>0!==e[t]))){for(a in s)__webpack_require__.o(s,a)&&(__webpack_require__.m[a]=s[a]);if(i)i(__webpack_require__)}for(t&&t(n);ocontrols_type,controls_typeLists:()=>controls_typeLists,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item,unpack_iterable_object:()=>unpack_iterable_object,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,datetime_fromtimestamp:()=>datetime_fromtimestamp,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free,get_unique_identifier:()=>get_unique_identifier});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,generate_cartesian_product:()=>generate_cartesian_product,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt,turn_to_int:()=>turn_to_int});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{ENUMERATE:()=>ENUMERATE,enumerate:()=>enumerate,list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_to_to:()=>dicts_to_to,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,lists_zip:()=>variables_lists_zip,unpack_iterable_object:()=>variables_unpack_iterable_object,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,datetime_fromtimestamp:()=>control_datetime_fromtimestamp,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,get_unique_identifier:()=>control_get_unique_identifier,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,generate_cartesian_product:()=>math_generate_cartesian_product,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt,turn_to_int:()=>math_turn_to_int});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{enumerate:()=>lists_enumerate,list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_to_to:()=>dicts_dicts_to_to,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_aggregate_func:()=>dataframe_aggregate_func,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_groupby:()=>dataframe_groupby,dataframe_head_tail:()=>dataframe_head_tail,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,dataframe_select:()=>dataframe_select,dataframe_sort_values:()=>dataframe_sort_values,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_cla:()=>plot_cla,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_aggregate_func:()=>data_dataframe_aggregate_func,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_groupby:()=>data_dataframe_groupby,dataframe_head_tail:()=>data_dataframe_head_tail,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,dataframe_select:()=>data_dataframe_select,dataframe_sort_values:()=>data_dataframe_sort_values,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_cla:()=>data_plot_cla,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,ZhHansMsg={PYTHON_PYODIDE_IMAGE:"图像"},ZhHansCatgories={},ZhHantMsg={PYTHON_PYODIDE_IMAGE:"影像"},ZhHantCatgories={},EnMsg={PYTHON_PYODIDE_IMAGE:"Image"},EnCatgories={};Object.assign(external_Blockly_namespaceObject.Lang.ZhHans,ZhHansMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant,ZhHantMsg),Object.assign(external_Blockly_namespaceObject.Lang.En,EnMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHans.MSG,ZhHansCatgories),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant.MSG,ZhHantCatgories),Object.assign(external_Blockly_namespaceObject.Lang.En.MSG,EnCatgories);const external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),a=0;a1&&(s+=a)):n=s}else n="i";return n}},variables=Variables; /** * @license * Visual Blocks Editor @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),a=0;a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},datetime_fromtimestamp={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"],[external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"bti"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,turn_to_int={init:function(){this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},generate_cartesian_product={init:function(){this.setColour(MATH_HUE),this.itemCount_=1,this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PRODUCT+external_Blockly_namespaceObject.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dicts_to_to={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+r()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():r(),e+="("+a+", "+_+", "+l+")");else{var p=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);i+=_+" = "+e+"\n",e=_}return e};a=p(a,"_start"),_=p(_,"_end");p(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):r(0,_):e(a,_,l)}return i+="for "+n+" in "+e+":\n"+s},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",s=t.statementToCode(e,"DO"),i=t.addLoopTrap(s,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+i},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,control_datetime_fromtimestamp=function(e,t){return t.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),s=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+s+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",s="10";if("two"==n?s="2":"eight"==n?s="8":"ten"==n?s="10":"sixteen"==n&&(s="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var i="int(str("+a+"), "+s+")";else i=l+"(int(str("+a+"), "+s+"))";return[i,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+a+',"big")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,math_turn_to_int=function(e,t){return t.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+").decode()",t.ORDER_ATOMIC]},math_generate_cartesian_product=function(e,t){t.definitions_.import_itertools="import itertools";let n=t.valueToCode(this,"REPEAT",t.ORDER_ATOMIC),a=new Array(this.itemCount_);for(let e=0;e",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var s=_+" and "+l;else if("OR"==n)s=_+" or "+l;else if("NOR"==n)s="not("+_+"^"+l+")";else s=_+"^"+l;return[s,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+i+" + "+_+")":_<0?"int("+i+" - "+-_+")":"int("+i+")",a&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},plot_cla={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},data_plot_cla=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),s=0;s{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:a}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new a(e);break;case"js":case"javascript":const{KernelJavaScript:_}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new _(e);break;case"sql":const{KernelSQL:l}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new l(e);break;case"ocaml":const{KernelOCaml:s}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new s(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then((()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const a="basthon-loader-"+(t?"full":"foot"),_=document.createElement("div");_.id=this._loaderId,_.classList.add("darklighted"),_.classList.add("basthon-loader-root"),_.classList.add(a);const l=document.createElement("div");l.classList.add("basthon-loader-container"),l.classList.add(a),_.appendChild(l);const s=document.createElement("div");s.classList.add("basthon-loader-spinner"),s.classList.add(a),s.innerHTML="",l.appendChild(s);const i=document.createElement("div");i.classList.add("basthon-loader-break"),i.classList.add(a),l.appendChild(i);const o=document.createElement("div");o.classList.add("basthon-loader-text"),o.classList.add(a),o.innerHTML=e,l.appendChild(o),this._loaderTextElem=o;const r=document.createElement("div");r.classList.add("basthon-loader-text"),r.classList.add(a),r.style.display="none",l.appendChild(r),this._loaderTextError=r,await this.pageLoad(),document.body.appendChild(_),this._rootLoader=_;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return s.classList.remove("basthon-loader-spinner"),s.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,e.remove()}),1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}const external_$_namespaceObject=$;var external_$_default=__webpack_require__.n(external_$_namespaceObject);const statusbar_image_namespaceObject='\n
\n\n
';class StatusBarImage extends external_Mixly_namespaceObject.PageBase{static{external_Mixly_namespaceObject.HTMLTemplate.add("html/statusbar/statusbar-image.html",new external_Mixly_namespaceObject.HTMLTemplate(statusbar_image_namespaceObject)),this.init=function(){external_Mixly_namespaceObject.StatusBarsManager.typesRegistry.register(["images"],StatusBarImage);const e=external_Mixly_namespaceObject.Workspace.getMain().getStatusBarsManager();e.add("images","images",external_Blockly_namespaceObject.Msg.PYTHON_PYODIDE_IMAGE),e.changeTo("output")}}constructor(){super();const e=external_$_default()(external_Mixly_namespaceObject.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let a=e.content,_=null,l=null;switch(e.display_type){case"p5":a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",new MutationObserver((function(e){e.forEach((e=>e.addedNodes.forEach((e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))))})).observe(a,{childList:!0}),a.querySelectorAll("canvas,video").forEach(n),t.append(a);break;case"matplotlib":_=a.querySelector("canvas"),_&&(a=_),a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"ocaml-canvas":a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"turtle":a.setAttribute("width","100%"),a.setAttribute("height","100%"),t.append(a.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let a=e.content[n];"image/png"===n&&(a=''),t.append(a);break}break;case"tutor":if(t.append(external_$_default()(e.content.replace("overflow-y%3A%20hidden%3B",""))),l=this.getContent()[0].getElementsByTagName("iframe")[0],null==l)return;l.style.maxHeight=l.style.minHeight="100%",new IntersectionObserver(((e,t)=>{const n=e[0];n&&!n.isIntersecting||(l.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())})).observe(l);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const statusbar_image=StatusBarImage;class PythonShell{static{this.pythonShell=null,this.init=async function(){statusbar_image.init();const e=external_path_.relative(external_Mixly_namespaceObject.Env.indexDirPath,external_Mixly_namespaceObject.Env.boardDirPath),t=new KernelLoader({rootPath:external_path_.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.pythonShell=new PythonShell,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer))},this.run=function(){const e=external_Mixly_namespaceObject.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#t=null;#n=null;#a={row:0,column:0};#_="";#l=null;#s=null;#i=!1;#o=!1;#r=null;#p=()=>this.#c();#u=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#a.row){const e=this.#e.getEndPos();let t=this.#e.getValueRange(this.#a,e);t=t.replace(this.#_,""),this.#l?.(t),this.#l=null,this.#s=null,this.#e.addValue("\n"),this.#m()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.output",(e=>{this.#e.addValue(e.content)})),this.#r.addEventListener("eval.error",(()=>{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.input",(e=>{const t=String(e?.content?.prompt);this.#e.addValue(t),this.#_=t,this.#l=e.resolve,this.#s=e.reject,this.#O()})),this.#r.addEventListener("eval.display",(e=>{this.#n.changeTo("images"),this.#t.display(e)}))}#c(){const e=this.#e.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{-1!==e.indexOf("import turtle")&&(e+="\nturtle.done()\n"),-1!==e.indexOf("import matplotlib.pyplot")&&(e+="\nplt.clf()\n"),this.#n.changeTo("output"),this.#n.show(),this.#e.setValue(`${external_Mixly_namespaceObject.Msg.Lang["shell.running"]}...\n`),this.#o=!0,this.#r.dispatchEvent("eval.request",{code:e,interactive:!1})})).catch(external_Mixly_namespaceObject.Debug.error)}async stop(){if(this.#i&&this.#m(),this.#o){const e=5;PythonShell.interruptBuffer[0]=2;const t=Number(new Date);for(;Number(new Date)-t<1e3*e&&this.#o;)PythonShell.interruptBuffer[0]=2,await this.sleep(100);this.#o=!1}}sleep(e){return new Promise((t=>setTimeout(t,e)))}}const python_shell=PythonShell,NavExt={init:async function(){const e=external_Mixly_namespaceObject.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{python_shell.run()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{python_shell.stop()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:5}),await python_shell.init()}},nav_ext=NavExt;nav_ext.init(),Object.assign(external_Blockly_namespaceObject.Variables,variables),Object.assign(external_Blockly_namespaceObject.Procedures,procedures),external_Blockly_namespaceObject.Python=Python,external_Blockly_namespaceObject.generator=Python,external_Mixly_namespaceObject.Profile.default={},Object.assign(external_Blockly_namespaceObject.Blocks,blocks_variables_namespaceObject,control_namespaceObject,math_namespaceObject,text_namespaceObject,lists_namespaceObject,dicts_namespaceObject,logic_namespaceObject,storage_namespaceObject,blocks_procedures_namespaceObject,tuple_namespaceObject,set_namespaceObject,html_namespaceObject,utility_namespaceObject,ai_namespaceObject,algorithm_namespaceObject,communicate_namespaceObject,cv_namespaceObject,data_namespaceObject,datastructure_namespaceObject,factory_namespaceObject,hardware_namespaceObject,inout_namespaceObject,iot_namespaceObject,pins_namespaceObject,serial_namespaceObject,sklearn_namespaceObject,system_namespaceObject,turtle_namespaceObject),Object.assign(external_Blockly_namespaceObject.Python.forBlock,generators_variables_namespaceObject,generators_control_namespaceObject,generators_math_namespaceObject,generators_text_namespaceObject,generators_lists_namespaceObject,generators_dicts_namespaceObject,generators_logic_namespaceObject,generators_storage_namespaceObject,generators_procedures_namespaceObject,generators_tuple_namespaceObject,generators_set_namespaceObject,generators_html_namespaceObject,generators_utility_namespaceObject,generators_ai_namespaceObject,generators_algorithm_namespaceObject,generators_communicate_namespaceObject,cv,generators_data_namespaceObject,generators_datastructure_namespaceObject,generators_factory_namespaceObject,generators_hardware_namespaceObject,generators_inout_namespaceObject,generators_iot_namespaceObject,generators_pins_namespaceObject,generators_serial_namespaceObject,generators_sklearn_namespaceObject,generators_system_namespaceObject,generators_turtle_namespaceObject)})(); \ No newline at end of file +class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),a=0;a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},datetime_fromtimestamp={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"],[external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"bti"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,turn_to_int={init:function(){this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_BYTE+external_Blockly_namespaceObject.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},generate_cartesian_product={init:function(){this.setColour(MATH_HUE),this.itemCount_=1,this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PRODUCT+external_Blockly_namespaceObject.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},dicts_to_to={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+r()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():r(),e+="("+a+", "+_+", "+l+")");else{var p=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);i+=_+" = "+e+"\n",e=_}return e};a=p(a,"_start"),_=p(_,"_end");p(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):r(0,_):e(a,_,l)}return i+="for "+n+" in "+e+":\n"+s},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",s=t.statementToCode(e,"DO"),i=t.addLoopTrap(s,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+i},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,control_datetime_fromtimestamp=function(e,t){return t.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),s=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+s+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",s="10";if("two"==n?s="2":"eight"==n?s="8":"ten"==n?s="10":"sixteen"==n&&(s="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var i="int(str("+a+"), "+s+")";else i=l+"(int(str("+a+"), "+s+"))";return[i,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+a+',"big")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,math_turn_to_int=function(e,t){return t.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+").decode()",t.ORDER_ATOMIC]},math_generate_cartesian_product=function(e,t){t.definitions_.import_itertools="import itertools";let n=t.valueToCode(this,"REPEAT",t.ORDER_ATOMIC),a=new Array(this.itemCount_);for(let e=0;e",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var s=_+" and "+l;else if("OR"==n)s=_+" or "+l;else if("NOR"==n)s="not("+_+"^"+l+")";else s=_+"^"+l;return[s,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+i+" + "+_+")":_<0?"int("+i+" - "+-_+")":"int("+i+")",a&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},plot_cla={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},data_plot_cla=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),s=0;s{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:a}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new a(e);break;case"js":case"javascript":const{KernelJavaScript:_}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new _(e);break;case"sql":const{KernelSQL:l}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new l(e);break;case"ocaml":const{KernelOCaml:s}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new s(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then((()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const a="basthon-loader-"+(t?"full":"foot"),_=document.createElement("div");_.id=this._loaderId,_.classList.add("darklighted"),_.classList.add("basthon-loader-root"),_.classList.add(a);const l=document.createElement("div");l.classList.add("basthon-loader-container"),l.classList.add(a),_.appendChild(l);const s=document.createElement("div");s.classList.add("basthon-loader-spinner"),s.classList.add(a),s.innerHTML="",l.appendChild(s);const i=document.createElement("div");i.classList.add("basthon-loader-break"),i.classList.add(a),l.appendChild(i);const o=document.createElement("div");o.classList.add("basthon-loader-text"),o.classList.add(a),o.innerHTML=e,l.appendChild(o),this._loaderTextElem=o;const r=document.createElement("div");r.classList.add("basthon-loader-text"),r.classList.add(a),r.style.display="none",l.appendChild(r),this._loaderTextError=r,await this.pageLoad(),document.body.appendChild(_),this._rootLoader=_;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return s.classList.remove("basthon-loader-spinner"),s.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,e.remove()}),1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}const external_$_namespaceObject=$;var external_$_default=__webpack_require__.n(external_$_namespaceObject);const statusbar_image_namespaceObject='\r\n
\r\n\r\n
';class StatusBarImage extends external_Mixly_namespaceObject.PageBase{static{external_Mixly_namespaceObject.HTMLTemplate.add("html/statusbar/statusbar-image.html",new external_Mixly_namespaceObject.HTMLTemplate(statusbar_image_namespaceObject)),this.init=function(){external_Mixly_namespaceObject.StatusBarsManager.typesRegistry.register(["images"],StatusBarImage);const e=external_Mixly_namespaceObject.Workspace.getMain().getStatusBarsManager();e.add("images","images",external_Blockly_namespaceObject.Msg.PYTHON_PYODIDE_IMAGE),e.changeTo("output")}}constructor(){super();const e=external_$_default()(external_Mixly_namespaceObject.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let a=e.content,_=null,l=null;switch(e.display_type){case"p5":a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",new MutationObserver((function(e){e.forEach((e=>e.addedNodes.forEach((e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))))})).observe(a,{childList:!0}),a.querySelectorAll("canvas,video").forEach(n),t.append(a);break;case"matplotlib":_=a.querySelector("canvas"),_&&(a=_),a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"ocaml-canvas":a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"turtle":a.setAttribute("width","100%"),a.setAttribute("height","100%"),t.append(a.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let a=e.content[n];"image/png"===n&&(a=''),t.append(a);break}break;case"tutor":if(t.append(external_$_default()(e.content.replace("overflow-y%3A%20hidden%3B",""))),l=this.getContent()[0].getElementsByTagName("iframe")[0],null==l)return;l.style.maxHeight=l.style.minHeight="100%",new IntersectionObserver(((e,t)=>{const n=e[0];n&&!n.isIntersecting||(l.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())})).observe(l);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const statusbar_image=StatusBarImage;class PythonShell{static{this.pythonShell=null,this.init=async function(){statusbar_image.init();const e=external_path_.relative(external_Mixly_namespaceObject.Env.indexDirPath,external_Mixly_namespaceObject.Env.boardDirPath),t=new KernelLoader({rootPath:external_path_.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.pythonShell=new PythonShell,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer))},this.run=function(){const e=external_Mixly_namespaceObject.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#t=null;#n=null;#a={row:0,column:0};#_="";#l=null;#s=null;#i=!1;#o=!1;#r=null;#p=()=>this.#c();#u=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#a.row){const e=this.#e.getEndPos();let t=this.#e.getValueRange(this.#a,e);t=t.replace(this.#_,""),this.#l?.(t),this.#l=null,this.#s=null,this.#e.addValue("\n"),this.#m()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.output",(e=>{this.#e.addValue(e.content)})),this.#r.addEventListener("eval.error",(()=>{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.input",(e=>{const t=String(e?.content?.prompt);this.#e.addValue(t),this.#_=t,this.#l=e.resolve,this.#s=e.reject,this.#O()})),this.#r.addEventListener("eval.display",(e=>{this.#n.changeTo("images"),this.#t.display(e)}))}#c(){const e=this.#e.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{-1!==e.indexOf("import turtle")&&(e+="\nturtle.done()\n"),-1!==e.indexOf("import matplotlib.pyplot")&&(e+="\nplt.clf()\n"),this.#n.changeTo("output"),this.#n.show(),this.#e.setValue(`${external_Mixly_namespaceObject.Msg.Lang["shell.running"]}...\n`),this.#o=!0,this.#r.dispatchEvent("eval.request",{code:e,interactive:!1})})).catch(external_Mixly_namespaceObject.Debug.error)}async stop(){if(this.#i&&this.#m(),this.#o){const e=5;PythonShell.interruptBuffer[0]=2;const t=Number(new Date);for(;Number(new Date)-t<1e3*e&&this.#o;)PythonShell.interruptBuffer[0]=2,await this.sleep(100);this.#o=!1}}sleep(e){return new Promise((t=>setTimeout(t,e)))}}const python_shell=PythonShell,NavExt={init:async function(){const e=external_Mixly_namespaceObject.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{python_shell.run()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{python_shell.stop()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:5}),await python_shell.init()}},nav_ext=NavExt;nav_ext.init(),Object.assign(external_Blockly_namespaceObject.Variables,variables),Object.assign(external_Blockly_namespaceObject.Procedures,procedures),external_Blockly_namespaceObject.Python=Python,external_Blockly_namespaceObject.generator=Python,external_Mixly_namespaceObject.Profile.default={},Object.assign(external_Blockly_namespaceObject.Blocks,blocks_variables_namespaceObject,control_namespaceObject,math_namespaceObject,text_namespaceObject,lists_namespaceObject,dicts_namespaceObject,logic_namespaceObject,storage_namespaceObject,blocks_procedures_namespaceObject,tuple_namespaceObject,set_namespaceObject,html_namespaceObject,utility_namespaceObject,ai_namespaceObject,algorithm_namespaceObject,communicate_namespaceObject,cv_namespaceObject,data_namespaceObject,datastructure_namespaceObject,factory_namespaceObject,hardware_namespaceObject,inout_namespaceObject,iot_namespaceObject,pins_namespaceObject,serial_namespaceObject,sklearn_namespaceObject,system_namespaceObject,turtle_namespaceObject),Object.assign(external_Blockly_namespaceObject.Python.forBlock,generators_variables_namespaceObject,generators_control_namespaceObject,generators_math_namespaceObject,generators_text_namespaceObject,generators_lists_namespaceObject,generators_dicts_namespaceObject,generators_logic_namespaceObject,generators_storage_namespaceObject,generators_procedures_namespaceObject,generators_tuple_namespaceObject,generators_set_namespaceObject,generators_html_namespaceObject,generators_utility_namespaceObject,generators_ai_namespaceObject,generators_algorithm_namespaceObject,generators_communicate_namespaceObject,cv,generators_data_namespaceObject,generators_datastructure_namespaceObject,generators_factory_namespaceObject,generators_hardware_namespaceObject,generators_inout_namespaceObject,generators_iot_namespaceObject,generators_pins_namespaceObject,generators_serial_namespaceObject,generators_sklearn_namespaceObject,generators_system_namespaceObject,generators_turtle_namespaceObject)})(); \ No newline at end of file diff --git a/boards/default/python_skulpt/main.bundle.js b/boards/default/python_skulpt/main.bundle.js index 67ff4ae2..f9fd84a0 100644 --- a/boards/default/python_skulpt/main.bundle.js +++ b/boards/default/python_skulpt/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class z{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+r.join("")+o.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},J.scrubNakedValue=function(t){return t+"\n"},J.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},J.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},J.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(r=t.getCommentText())&&(r=Y.utils.string.wrap(r,J.COMMENT_WRAP-3),i+=J.prefixLines(r+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const K=330,Q={init:function(){this.setColour(K),this.appendDummyInput().appendField(new Y.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(Y.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Z={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new Y.FieldTextInput(""),"VAR").appendField(Y.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},tt={init:function(){this.setColour(K);var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"],[Y.Msg.LANG_MATH_BOOLEAN,"bool"],[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0)}},et={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},nt={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(Y.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},it={init:function(){this.setColour(K),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new Y.FieldDropdown([[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[Y.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"],[Y.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return Y.Msg.MICROBIT_controls_TypeLists+{int:Y.Msg.LANG_MATH_INT,float:Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:Y.Msg.MIXLY_MICROBIT_TYPE_STRING,list:Y.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:Y.Msg.MIXLY_MICROBIT_TYPE_DICT,set:Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:Y.Msg.MIXLY_MICROBIT_IMAGE,bytes:Y.Msg.LANG_MATH_BYTE,NoneType:Y.Msg.LOGIC_NULL}[e]}))}},st={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new Y.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(Y.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_if_else");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(lt),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ft={init:function(){this.setColour(lt),this.appendValueInput("LIST").setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Y.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mt={init:function(){this.setColour(lt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Y.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Y.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},gt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_finally");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},bt={init:function(){this.setColour(lt);var t=new Y.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},St={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},kt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};mt.OPERATORS=[[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],bt.OPERATORS=[[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const yt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Tt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},vt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},$t={init:function(){this.setColour(lt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},wt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Et={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},It={init:function(){this.jsonInit({message0:Y.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:lt,tooltip:Y.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Y.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},At={init:function(){this.setColour(lt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_STAT),this.setOutput(!0)}},Ot={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Mt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Ct={init:function(){this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Y.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Y.FieldDropdown([[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Rt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Nt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},Lt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET+Y.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_GET_UNIQUE_IDEN)}},Dt={init:function(){this.setColour(lt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Y.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Ft=230;Y.FieldTextInput.math_number_validator=function(t){return String(t)},Y.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Pt={init:function(){this.setColour(Ft),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},Bt={init:function(){this.setColour(Ft);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Vt={init:function(){this.setColour(Ft);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ut={init:function(){this.setColour(Ft),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Yt={init:function(){this.setColour(Ft),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},jt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Y.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Gt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Y.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Y.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Y.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Y.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Y.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Y.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Y.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Xt={init:function(){var t=[[Y.Msg.MATH_BIN,"bin"],[Y.Msg.MATH_OCT,"oct"],[Y.Msg.MATH_HEX,"hex"]];this.setColour(Ft),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Y.Msg.MATH_DEC_TOOLTIP_BIN,oct:Y.Msg.MATH_DEC_TOOLTIP_OCT,hex:Y.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ht={init:function(){var t=[[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"],[Y.Msg.MATH_ABS,"fabs"],[Y.Msg.MATH_SQRT,"sqrt"]];this.setColour(Ft),this.appendValueInput("A").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Y.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Y.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Y.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Y.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Y.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Y.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},qt={init:function(){var t=[[Y.Msg.MIXLY_MAX,"max"],[Y.Msg.MIXLY_MIN,"min"]];this.setColour(Ft),this.appendValueInput("A").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(new Y.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Y.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Y.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Y.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},zt={init:function(){var t=[[Y.Msg.MATH_TWO,"two"],[Y.Msg.MATH_EIGHT,"eight"],[Y.Msg.MATH_TEN,"ten"],[Y.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Ft),this.appendDummyInput("").appendField(Y.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Y.FieldDropdown(t),"OP").appendField(Y.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Y.Msg.MATH_ZHW).appendField(new Y.FieldDropdown(t),"OP2").appendField(Y.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:Y.Msg.MATH_Before_two,eight:Y.Msg.MATH_Before_eight,ten:Y.Msg.MATH_Before_ten,sixteen:Y.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:Y.Msg.MATH_Behind_two,eight:Y.Msg.MATH_Behind_eight,ten:Y.Msg.MATH_Behind_ten,sixteen:Y.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},Wt={init:function(){var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Ft),this.setOutput(!0,Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Y.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:Y.Msg.LANG_MATH_INT,float:Y.Msg.LANG_MATH_FLOAT_RANDOM};return Y.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},Jt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(Ft),this.appendValueInput("NUM",Number).appendField(Y.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Y.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Y.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Qt={init:function(){this.setColour(Ft),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},Zt={init:function(){this.setColour(Ft),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},te={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MATH_ROUND).appendField(Y.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Y.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_ROUND_NEW_TOOLTIP)}},ee={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"],[Y.Msg.MIXLY_TO_BITES,"b"],[Y.Msg.LANG_MATH_BYTE+Y.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Ft),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Y.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ne={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Ft),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Y.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ie=Kt,se={init:function(){this.setColour(Ft),this.appendValueInput("VAR").appendField(Y.Msg.LANG_MATH_BYTE+Y.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},re={init:function(){this.setColour(Ft),this.itemCount_=1,this.setMutator(new Y.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Y.Msg.MIXLY_PRODUCT+Y.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Y.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Y.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ue={init:function(){this.setColour(oe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput("",Y.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Y.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Y.FieldImage(e,7,12,'"')}},ce={init:function(){this.setColour(oe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Y.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},pe={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},he={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(String).appendField(Y.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},_e={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},de={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},fe={init:function(){this.WHERE_OPTIONS=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.TEXT_GET_INDEX_RANDOM+1+Y.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.LISTS_GET_INDEX_GET,"MODE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Y.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Y.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Y.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:Y.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Y.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Y.Msg.TEXT_GET_INDEX_RANDOM};return Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+Y.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Y.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Y.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},me={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.LISTS_GET_INDEX_FROM_START+"n"+Y.Msg.TEXT_CHARAT2)}},ge={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Y.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Y.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},be={init:function(){this.WHERE_OPTIONS_1=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Y.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Y.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new Y.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Se={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Y.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ke={init:function(){var t=[[Y.Msg.MIXLY_EQUALS,"==="],[Y.Msg.MIXLY_STARTSWITH,"startswith"],[Y.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(oe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Y.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ye={init:function(){this.setColour(oe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_COMPARETO_HELP)}},Te={init:function(){var t=[[Y.Msg.TEXT_UPPER,"upper"],[Y.Msg.TEXT_TITLE,"title"],[Y.Msg.TEXT_CAPITALIZE,"capitalize"],[Y.Msg.TEXT_SWAPCASE,"swapcase"],[Y.Msg.TEXT_LOWER,"lower"]];this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Y.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Y.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Y.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Y.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Y.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ve={init:function(){var t=[[Y.Msg.TEXT_LJUST,"ljust"],[Y.Msg.TEXT_CENTER,"center"],[Y.Msg.TEXT_RJUST,"rjust"]];this.setColour(oe),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Y.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Y.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},$e={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Y.Msg.MIXLY_MID+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Y.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},we={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ee={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Y.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ie={init:function(){this.setColour(oe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Y.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Y.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ae={init:function(){var t=[[Y.Msg.TEXT_TRIM_BOTH,"strip"],[Y.Msg.TEXT_TRIM_LEFT,"lstrip"],[Y.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(oe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Y.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Y.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Y.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Y.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Oe={init:function(){this.setColour(oe),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Y.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wn={init:function(){this.setColour(vn),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},En={init:function(){this.setColour(vn),this.appendDummyInput().appendField(Y.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},In={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_KEYS),this.setTooltip(Y.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},An={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_TOOLTIP)}},On={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Mn={init:function(){this.setColour(vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Cn={init:function(){this.setColour(vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_DELETE_TOOLTIP)}},Rn={init:function(){this.setColour(vn),this.appendValueInput("DICT2").setCheck("Dict").appendField(Y.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Y.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MID),this.setTooltip(Y.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_CLEAR),this.setTooltip(Y.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_ITEMS),this.setTooltip(Y.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Ln={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_VALUES),this.setTooltip(Y.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Dn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_LENGTH),this.setTooltip(Y.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_DELDICT),this.setTooltip(Y.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pn={init:function(){this.MODE=[[Y.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Y.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Y.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Y.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Y.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Y.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Bn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setTooltip(Y.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Vn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Un={init:function(){this.setColour(vn),this.appendDummyInput("").appendField(new Y.FieldLabel(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Y.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Yn={init:function(){this.setColour(vn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},jn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_TO_JSON),this.setTooltip(Y.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gn={init:function(){this.setColour(vn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hn=210,qn={init:function(){var t=Y.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Y.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Y.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},zn={init:function(){var t=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Y.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Wn={init:function(){var t=[[Y.Msg.LOGIC_OPERATION_AND,"AND"],[Y.Msg.LOGIC_OPERATION_OR,"OR"],[Y.Msg.LOGIC_OPERATION_NOR,"NOR"],[Y.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Y.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Y.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Jn={init:function(){this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Y.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Y.Msg.LOGIC_NEGATE_TOOLTIP)}},Kn={init:function(){var t=[[Y.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Y.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Y.FieldDropdown(t),"BOOL"),this.setTooltip(Y.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Qn={init:function(){this.setColour(Hn),this.setOutput(!0),this.appendDummyInput().appendField(Y.Msg.LOGIC_NULL),this.setTooltip(Y.Msg.LOGIC_NULL_TOOLTIP)}},Zn={init:function(){this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Y.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Y.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},ti={init:function(){var t=[[Y.Msg.TEXT_APPEND_TO,"in"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Y.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Y.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.IN)}},ei={init:function(){var t=[[Y.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},ni={init:function(){this.setColour(Hn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},ii={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Y.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},si={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ri={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},oi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXPY_TEXT_ENCODE).appendField(new Y.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},ai={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},li={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ui={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},ci={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},pi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.HTML_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},hi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},_i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},di={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const fi={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},gi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},Si={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},ki={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Y.Msg.MIXLY_ESP32_SET+{mkdir:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},yi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Y.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Ti={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.HTML_FILE,"isfile"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},$i={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Y.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_SETUP+Y.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Y.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Y.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Ei={init:function(){var t=q.findLegalName("",this),e=new Y.FieldTextInput(t,q.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new Y.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Y.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Y.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Y.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Y.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(Y.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=Y.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Y.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{Y.Events.enable()}},mutationToDom:function(t){var e=Y.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ks={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_FORM_CONTENT).appendField(new Y.FieldDropdown([[Y.Msg.HTML_TEXT,"text"],[Y.Msg.HTML_EMAIL,"email"],[Y.Msg.HTML_NUMBER,"number"],[Y.Msg.HTML_PASSWORD,"password"],[Y.Msg.HTML_CHECKBOX,"checkbox"],[Y.Msg.HTML_RADIOBUTTON,"radiobutton"],[Y.Msg.HTML_BUTTON,"button"],[Y.Msg.HTML_COLOUR,"colour"],[Y.Msg.HTML_DATE,"date"],[Y.Msg.HTML_LOCALTIME,"local time"],[Y.Msg.HTML_FILE,"file"],[Y.Msg.HTML_HIDDEN,"hidden"],[Y.Msg.HTML_IMAGE,"image"],[Y.Msg.HTML_MONTH,"month"],[Y.Msg.HTML_RANGE,"range"],[Y.Msg.HTML_RESET,"reset"],[Y.Msg.HTML_SEARCH,"search"],[Y.Msg.HTML_SUBMIT,"submit"],[Y.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Y.Msg.HTML_TIME,"time"],[Y.Msg.HTML_URL,"url"],[Y.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Y.Msg.HTML_NAME).appendField(new Y.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Y.Msg.HTML_VALUE).appendField(new Y.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ys={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ts={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vs={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_TEXT).appendField(new Y.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s=160,ws={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Y.FieldTable(""),"TEXT")}},Es={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT")}},Is={init:function(){this.setColour($s),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},As={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Os={init:function(){this.setColour($s),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Y.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ms={init:function(){this.setColour($s),this.appendValueInput("VALUE").appendField(Y.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Cs={init:function(){this.setColour($s),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Y.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$o={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(uo),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_SPLITBYDOU).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Io={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Ao={init:function(){this.setColour(uo);var t=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],e=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Oo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Mo={init:function(){this.setColour(uo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Co={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ro={init:function(){this.setColour(uo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},No={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(uo),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Y.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setTooltip(Y.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Lo={init:function(){this.setColour(uo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Do={init:function(){this.setColour(uo),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Y.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Fo={init:function(){this.setColour(uo),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Y.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Y.FieldDropdown([[Y.Msg.DATAFRAME_COLUMN,"column"],[Y.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Y.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Po={init:function(){this.setColour(uo),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Bo={init:function(){this.setColour(uo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},Vo={init:function(){this.setColour(uo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},Uo={init:function(){this.setColour(uo),this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Go={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ho={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zo={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Wo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Jo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ko={init:function(){this.setColour(uo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Qo={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Zo={init:function(){this.setColour(uo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ta={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},ea={init:function(){this.setColour(uo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},na={init:function(){this.setColour(uo),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ia={init:function(){this.setColour(uo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},sa=20,ra={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Y.Msg.INOUT_input_TOOLTIP)}},oa={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.BLOCKPY_PRINT_TOOLTIP)}},aa={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},la={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Y.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},ua={init:function(){var t=[[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(sa),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(Y.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:Y.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Y.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Y.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},ca={init:function(){this.setColour(sa),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},Y.isNumber(i)&&Y.isNumber(s)&&Y.isNumber(r))i=parseFloat(i),s=parseFloat(s),r=Math.abs(parseFloat(r)),0==i%1&&0==s%1&&0==r%1?(i<=s?(s++,t=0==i&&1==r?s:i+", "+s,1!=r&&(t+=", "+r)):t=i+", "+--s+", -"+r,t="range("+t+")"):(t=i",GTE:">="};const fp=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",r=e.valueToCode(this,"B",i)||"False";if("AND"==n)var o=s+" and "+r;else if("OR"==n)o=s+" or "+r;else if("NOR"==n)o="not("+s+"^"+r+")";else o=s+"^"+r;return[o,i]},mp=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},gp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},bp=function(t,e){return["None",e.ORDER_ATOMIC]},Sp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},kp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},yp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Tp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},vp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},$p=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},wp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Ep=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Ip=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},Ap=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Op=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Mp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Cp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Rp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},xp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Np=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Lp=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Dp=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Fp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Pp=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},Bp=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Vp=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Up=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Yp=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},jp=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},Gp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Xp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Hp=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),Y.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var r=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Eh=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},Ih=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},Ah=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Oh=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},Mh=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ch=function(t,e){return'"},Rh=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},xh=function(){return this.getFieldValue("TEXT")+"\n"},Nh=function(t){return t.getFieldValue("TEXT")+"\n"},Lh=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Dh=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Fh=function(){return""},Ph=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Bh=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),r=0;r6:\n print("路线错乱!程序有误!")\n exit()\n'},i_=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},s_=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},r_=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},o_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},a_=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},l_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},u_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},c_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},p_=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},h_=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},__=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},d_=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},f_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},m_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},g_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},b_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},S_=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},k_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},y_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},T_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},v_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},$_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},w_=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},E_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},I_=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},A_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},O_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},M_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},C_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},R_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},x_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},N_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},L_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},D_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},F_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},P_=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},B_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},V_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},U_=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if athis.#t.on("display",t)[0],_m.configure({output:t=>{this.#t.run("output",{content:t})},read:this.readFile.bind(this),inputfun:this.skInput.bind(this),inputfunTakesPrompt:!0,execLimit:Number.POSITIVE_INFINITY,fileread:this.fileread.bind(this),filewrite:this.filewrite.bind(this),__future__:_m.python3}),_m.builtins.value=new _m.builtin.func((function(){return _m.ffi.remapToPy(void 0===fm?5:fm)})),_m.builtins.set_value=new _m.builtin.func((function(t){fm=t.v})),_m.builtinFiles.files["./mixpy.py"]='import math\n\ndef math_map(v, al, ah, bl, bh):\n return bl + (bh - bl) * (v - al) / (ah - al)\n\ndef math_mean(myList):\n localList = [e for e in myList if type(e) == int or type(e) == float]\n if not localList: return\n return float(sum(localList)) / len(localList)\n\ndef math_median(myList):\n localList = sorted([e for e in myList if type(e) == int or type(e) == float])\n if not localList: return\n if len(localList) % 2 == 0:\n return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0\n else:\n return localList[(len(localList) - 1) // 2]\n\ndef math_modes(some_list):\n modes = []\n # Using a lists of [item, count] to keep count rather than dict\n # to avoid "unhashable" errors when the counted item is itself a list or dict.\n counts = []\n maxCount = 1\n for item in some_list:\n found = False\n for count in counts:\n if count[0] == item:\n count[1] += 1\n maxCount = max(maxCount, count[1])\n found = True\n if not found:\n counts.append([item, 1])\n for counted_item, item_count in counts:\n if item_count == maxCount:\n modes.append(counted_item)\n return modes\n\ndef math_standard_deviation(numbers):\n n = len(numbers)\n if n == 0: return\n mean = float(sum(numbers)) / n\n variance = sum((x - mean) ** 2 for x in numbers) / n\n return math.sqrt(variance)\n\ndef lists_sort(my_list, type, reverse):\n def try_float(s):\n try:\n return float(s)\n except:\n return 0\n key_funcs = {\n "NUMERIC": try_float,\n "TEXT": str,\n "IGNORE_CASE": lambda s: str(s).lower()\n }\n key_func = key_funcs[type]\n list_cpy = list(my_list)\n return sorted(list_cpy, key=key_func, reverse=reverse)'}readFile(t){if(void 0!==dm[t])return _m.misceval.promiseToSuspension(fetch(dm[t]).then((t=>t.text())));if(void 0===_m.builtinFiles||void 0===_m.builtinFiles.files[t])throw"File not found: '"+t+"'";return _m.builtinFiles.files[t]}fileread(t,e){return this.mixpyProject.exist(t)?this.mixpyProject.getFileContent(t):-1!==e.indexOf("w")?(this.mixpyProject.add(t,"",1),""):null}filewrite(t,e){var n=t.name;this.mixpyProject.modify(n,e),this.mixpyProject.select(n)}skInput(t){return new Promise(((e,n)=>{this.#t.run("input",{content:{prompt:t},resolve:e,reject:n})}))}reset(){_m.execLimit=Number.POSITIVE_INFINITY,_m.TurtleGraphics.reset&&_m.TurtleGraphics.reset()}kill(){window.SPRITE.kill(),_m.execLimit=0,this.executionEnd_()}step(t,e,n,i){if(".py"==i){var s=this.executionBuffer.step,r=this.parseGlobals(t);this.executionBuffer.trace.push({step:s,filename:i,line:e,column:n,properties:r.properties,modules:r.modules}),this.executionBuffer.step=s+1,this.executionBuffer.last_step=s+1,this.executionBuffer.line_number=e}}analyzeVariables(){if(""==this.main.model.programs.__main__().trim())return{}}analyze(){return this.main.model.execution.status("analyzing"),""!=this.main.model.programs.__main__().trim()||(this.main.components.feedback.emptyProgram("You haven't written any code yet!"),!1)}run(t){this.reset(),-1===t.indexOf("import sprite")&&-1===t.indexOf("from sprite import")||window.SPRITE.runit(_m.TurtleGraphics.target),this.programStatus.running=!0,_m.misceval.asyncToPromise((()=>_m.importMainWithBody("",!1,t,!0))).then((()=>{window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("finished")})).catch((t=>{j.Debug.error(t),window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("error",t);var e=function(t){return"string"==typeof t?t:void 0!==t.tp$str?t.tp$str().v:t.name+": "+t.message}(t);this.#t.run("finished"),-1===e.indexOf("TimeLimitError")&&this.executionEnd_()}))}setupEnvironment(t,e,n,i,s){var r=this.main.model;this._backup_execution=_m.afterSingleExecution,_m.afterSingleExecution=void 0,_m.builtins.get_output=new _m.builtin.func((function(){return _m.builtin.pyCheckArgs("get_output",arguments,0,0),_m.ffi.remapToPy(r.execution.output())})),_m.builtins.reset_output=new _m.builtin.func((function(){_m.builtin.pyCheckArgs("reset_output",arguments,0,0),r.execution.output.removeAll()})),_m.builtins.log=new _m.builtin.func((function(t){_m.builtin.pyCheckArgs("log",arguments,1,1),console.log(t)})),_m.builtins._trace=e,_m.builtins._final_values=s,_m.builtins.code=_m.ffi.remapToPy(t),_m.builtins.set_success=this.instructor_module.set_success,_m.builtins.set_feedback=this.instructor_module.set_feedback,_m.builtins.set_finished=this.instructor_module.set_finished,_m.builtins.count_components=this.instructor_module.count_components,_m.builtins.no_nonlist_nums=this.instructor_module.no_nonlist_nums,_m.builtins.only_printing_properties=this.instructor_module.only_printing_properties,_m.builtins.calls_function=this.instructor_module.calls_function,_m.builtins.get_property=this.instructor_module.get_property,_m.builtins.get_value_by_name=this.instructor_module.get_value_by_name,_m.builtins.get_value_by_type=this.instructor_module.get_value_by_type,_m.builtins.parse_json=this.instructor_module.parse_json,_m.skip_drawing=!0,r.settings.mute_printer(!0)}disposeEnvironment(){_m.afterSingleExecution=this._backup_execution,_m.builtins.get_output=void 0,_m.builtins.reset_output=void 0,_m.builtins.log=void 0,_m.builtins._trace=void 0,_m.builtins.trace=void 0,_m.builtins.code=void 0,_m.builtins.set_success=void 0,_m.builtins.set_feedback=void 0,_m.builtins.set_finished=void 0,_m.builtins.count_components=void 0,_m.builtins.calls_function=void 0,_m.builtins.get_property=void 0,_m.builtins.get_value_by_name=void 0,_m.builtins.get_value_by_type=void 0,_m.builtins.no_nonlist_nums=void 0,_m.builtins.only_printing_properties=void 0,_m.builtins.parse_json=void 0,_m.skip_drawing=!1,fm=void 0,this.main.model.settings.mute_printer(!1)}parseGlobals(t){var e=Array(),n=Array();for(var i in t){var s=t[i];if("__name__"!==i&&"__doc__"!==i){i=i.replace("_$rw$","").replace("_$rn$","");var r=this.parseValue(i,s);null!==r?e.push(r):s.constructor==_m.builtin.module&&n.push(s.$d.__name__.v)}}return{properties:e,modules:n}}parseValue(t,e){if(null==e)return{name:t,type:"Unknown",value:"Undefined"};switch(e.constructor){case _m.builtin.func:return{name:t,type:"Function",value:void 0!==e.func_code.co_varnames?" Arguments: "+e.func_code.co_varnames.join(", "):" No arguments"};case _m.builtin.module:return null;case _m.builtin.str:return{name:t,type:"String",value:e.$r().v};case _m.builtin.none:return{name:t,type:"None",value:"None"};case _m.builtin.bool:return{name:t,type:"Boolean",value:e.$r().v};case _m.builtin.nmber:return{name:t,type:"int"==e.skType?"Integer":"Float",value:e.$r().v};case _m.builtin.int_:return{name:t,type:"Integer",value:e.$r().v};case _m.builtin.float_:return{name:t,type:"Float",value:e.$r().v};case _m.builtin.tuple:return{name:t,type:"Tuple",value:e.$r().v};case _m.builtin.list:return e.v.length<=20?{name:t,type:"List",value:e.$r().v,exact_value:e}:{name:t,type:"List",value:"[... "+e.v.length+" elements ...]",exact_value:e};case _m.builtin.dict:return{name:t,type:"Dictionary",value:e.$r().v};case Number:return{name:t,type:e%1==0?"Integer":"Float",value:e};case String:return{name:t,type:"String",value:e};case Boolean:return{name:t,type:"Boolean",value:e?"True":"False"};default:return{name:t,type:null==e.tp$name?e:e.tp$name,value:null==e.$r?e:e.$r().v}}}}const gm=$;var bm=n.n(gm);class Sm extends j.PageBase{static{j.HTMLTemplate.add("html/statusbar/statusbar-image.html",new j.HTMLTemplate('\n
\n
\n
')),this.init=function(){j.StatusBarsManager.typesRegistry.register(["images"],Sm);const t=j.Workspace.getMain().getStatusBarsManager();t.add("images","images","图像"),t.changeTo("output")}}constructor(){super();const t=bm()(j.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,r=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(bm()(t.content.replace("overflow-y%3A%20hidden%3B",""))),r=this.getContent()[0].getElementsByTagName("iframe")[0],null==r)return;r.style.maxHeight=r.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(r.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(r);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const km=Sm;class ym{static{this.pythonShell=null,this.init=async function(){km.init(),this.pythonShell=new ym},this.run=function(){const t=j.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#n=null;#i=null;#s={row:0,column:0};#r="";#o=null;#a=null;#l=!1;#u=!1;#c=null;#p=()=>this.#h();#_=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#s.row){const t=this.#e.getEndPos();let e=this.#e.getValueRange(this.#s,t);return e=e.replace(this.#r,""),this.#o?.(e),this.#o=null,this.#a=null,this.#e.addValue("\n"),this.#d(),!0}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#u=!1,this.#e.addValue(`\n==${j.Msg.Lang["shell.finish"]}==`)})),t.bind("output",(t=>{this.#e.addValue(t.content)})),t.bind("error",(t=>{this.#u=!1,this.#e.addValue(`\n${t.toString()}\n`)})),t.bind("input",(t=>{const e=String(t?.content?.prompt);this.#e.addValue(`>>> ${e}`),this.#r=e,this.#o=t.resolve,this.#a=t.reject,this.#m()})),t.bind("display",(t=>{this.#i.changeTo("images"),this.#n.display(t)}))}#h(){const t=this.#e.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.rowsetTimeout(e,t)))}}const Tm=ym,vm={init:function(){Tm.init();const t=j.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Y.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{Tm.run().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Y.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{Tm.stop().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:5})}};vm.init(),Object.assign(Y.Variables,X),Object.assign(Y.Procedures,q),Y.Python=J,Y.generator=J,j.Profile.default={},Object.assign(Y.Blocks,t,e,i,s,r,o,a,l,u,c,p,h,_,d,f,m,g,b,S,k),Object.assign(Y.Python.forBlock,y,T,v,w,E,I,A,O,M,C,R,x,N,L,D,F,P,B,V,U)})()})(); \ No newline at end of file +class z{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+r.join("")+o.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},J.scrubNakedValue=function(t){return t+"\n"},J.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},J.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},J.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(r=t.getCommentText())&&(r=Y.utils.string.wrap(r,J.COMMENT_WRAP-3),i+=J.prefixLines(r+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const K=330,Q={init:function(){this.setColour(K),this.appendDummyInput().appendField(new Y.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(Y.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Z={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new Y.FieldTextInput(""),"VAR").appendField(Y.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},tt={init:function(){this.setColour(K);var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"],[Y.Msg.LANG_MATH_BOOLEAN,"bool"],[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0)}},et={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},nt={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(Y.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},it={init:function(){this.setColour(K),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new Y.FieldDropdown([[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[Y.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"],[Y.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return Y.Msg.MICROBIT_controls_TypeLists+{int:Y.Msg.LANG_MATH_INT,float:Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:Y.Msg.MIXLY_MICROBIT_TYPE_STRING,list:Y.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:Y.Msg.MIXLY_MICROBIT_TYPE_DICT,set:Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:Y.Msg.MIXLY_MICROBIT_IMAGE,bytes:Y.Msg.LANG_MATH_BYTE,NoneType:Y.Msg.LOGIC_NULL}[e]}))}},st={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new Y.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(Y.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_if_else");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(lt),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ft={init:function(){this.setColour(lt),this.appendValueInput("LIST").setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Y.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mt={init:function(){this.setColour(lt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Y.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Y.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},gt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_finally");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},bt={init:function(){this.setColour(lt);var t=new Y.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},St={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},kt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};mt.OPERATORS=[[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],bt.OPERATORS=[[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const yt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Tt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},vt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},$t={init:function(){this.setColour(lt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},wt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Et={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},It={init:function(){this.jsonInit({message0:Y.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:lt,tooltip:Y.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Y.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},At={init:function(){this.setColour(lt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_STAT),this.setOutput(!0)}},Ot={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Mt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Ct={init:function(){this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Y.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Y.FieldDropdown([[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Rt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Nt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},Lt={init:function(){this.setColour(lt),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET+Y.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_GET_UNIQUE_IDEN)}},Dt={init:function(){this.setColour(lt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Y.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Ft=230;Y.FieldTextInput.math_number_validator=function(t){return String(t)},Y.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Pt={init:function(){this.setColour(Ft),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},Bt={init:function(){this.setColour(Ft);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Vt={init:function(){this.setColour(Ft);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ut={init:function(){this.setColour(Ft),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Yt={init:function(){this.setColour(Ft),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},jt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Y.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Gt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Y.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Y.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Y.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Y.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Y.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Y.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Y.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Xt={init:function(){var t=[[Y.Msg.MATH_BIN,"bin"],[Y.Msg.MATH_OCT,"oct"],[Y.Msg.MATH_HEX,"hex"]];this.setColour(Ft),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Y.Msg.MATH_DEC_TOOLTIP_BIN,oct:Y.Msg.MATH_DEC_TOOLTIP_OCT,hex:Y.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ht={init:function(){var t=[[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"],[Y.Msg.MATH_ABS,"fabs"],[Y.Msg.MATH_SQRT,"sqrt"]];this.setColour(Ft),this.appendValueInput("A").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Y.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Y.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Y.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Y.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Y.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Y.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},qt={init:function(){var t=[[Y.Msg.MIXLY_MAX,"max"],[Y.Msg.MIXLY_MIN,"min"]];this.setColour(Ft),this.appendValueInput("A").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(new Y.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Y.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Y.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Y.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},zt={init:function(){var t=[[Y.Msg.MATH_TWO,"two"],[Y.Msg.MATH_EIGHT,"eight"],[Y.Msg.MATH_TEN,"ten"],[Y.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Ft),this.appendDummyInput("").appendField(Y.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Y.FieldDropdown(t),"OP").appendField(Y.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Y.Msg.MATH_ZHW).appendField(new Y.FieldDropdown(t),"OP2").appendField(Y.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:Y.Msg.MATH_Before_two,eight:Y.Msg.MATH_Before_eight,ten:Y.Msg.MATH_Before_ten,sixteen:Y.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:Y.Msg.MATH_Behind_two,eight:Y.Msg.MATH_Behind_eight,ten:Y.Msg.MATH_Behind_ten,sixteen:Y.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},Wt={init:function(){var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Ft),this.setOutput(!0,Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Y.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:Y.Msg.LANG_MATH_INT,float:Y.Msg.LANG_MATH_FLOAT_RANDOM};return Y.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},Jt={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(Ft),this.appendValueInput("NUM",Number).appendField(Y.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Y.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Y.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Qt={init:function(){this.setColour(Ft),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},Zt={init:function(){this.setColour(Ft),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},te={init:function(){this.setColour(Ft),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MATH_ROUND).appendField(Y.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Y.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_ROUND_NEW_TOOLTIP)}},ee={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"],[Y.Msg.MIXLY_TO_BITES,"b"],[Y.Msg.LANG_MATH_BYTE+Y.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Ft),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Y.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ne={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Ft),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Y.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ie=Kt,se={init:function(){this.setColour(Ft),this.appendValueInput("VAR").appendField(Y.Msg.LANG_MATH_BYTE+Y.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},re={init:function(){this.setColour(Ft),this.itemCount_=1,this.setMutator(new Y.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Y.Msg.MIXLY_PRODUCT+Y.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Y.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Y.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ue={init:function(){this.setColour(oe),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput("",Y.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Y.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Y.FieldImage(e,7,12,'"')}},ce={init:function(){this.setColour(oe),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Y.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},pe={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},he={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(String).appendField(Y.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},_e={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},de={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},fe={init:function(){this.WHERE_OPTIONS=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.TEXT_GET_INDEX_RANDOM+1+Y.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.LISTS_GET_INDEX_GET,"MODE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Y.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Y.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Y.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:Y.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Y.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Y.Msg.TEXT_GET_INDEX_RANDOM};return Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+Y.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Y.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Y.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},me={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.LISTS_GET_INDEX_FROM_START+"n"+Y.Msg.TEXT_CHARAT2)}},ge={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Y.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Y.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},be={init:function(){this.WHERE_OPTIONS_1=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Y.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Y.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new Y.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Se={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Y.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ke={init:function(){var t=[[Y.Msg.MIXLY_EQUALS,"==="],[Y.Msg.MIXLY_STARTSWITH,"startswith"],[Y.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(oe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Y.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ye={init:function(){this.setColour(oe),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_COMPARETO_HELP)}},Te={init:function(){var t=[[Y.Msg.TEXT_UPPER,"upper"],[Y.Msg.TEXT_TITLE,"title"],[Y.Msg.TEXT_CAPITALIZE,"capitalize"],[Y.Msg.TEXT_SWAPCASE,"swapcase"],[Y.Msg.TEXT_LOWER,"lower"]];this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Y.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Y.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Y.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Y.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Y.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ve={init:function(){var t=[[Y.Msg.TEXT_LJUST,"ljust"],[Y.Msg.TEXT_CENTER,"center"],[Y.Msg.TEXT_RJUST,"rjust"]];this.setColour(oe),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Y.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Y.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},$e={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Y.Msg.MIXLY_MID+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Y.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},we={init:function(){this.setColour(oe),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ee={init:function(){this.setColour(oe),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Y.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ie={init:function(){this.setColour(oe),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Y.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Y.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ae={init:function(){var t=[[Y.Msg.TEXT_TRIM_BOTH,"strip"],[Y.Msg.TEXT_TRIM_LEFT,"lstrip"],[Y.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(oe),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Y.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Y.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Y.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Y.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Oe={init:function(){this.setColour(oe),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Y.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wn={init:function(){this.setColour(vn),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},En={init:function(){this.setColour(vn),this.appendDummyInput().appendField(Y.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},In={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_KEYS),this.setTooltip(Y.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},An={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_TOOLTIP)}},On={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Mn={init:function(){this.setColour(vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Cn={init:function(){this.setColour(vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_DELETE_TOOLTIP)}},Rn={init:function(){this.setColour(vn),this.appendValueInput("DICT2").setCheck("Dict").appendField(Y.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Y.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MID),this.setTooltip(Y.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_CLEAR),this.setTooltip(Y.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_ITEMS),this.setTooltip(Y.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Ln={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_VALUES),this.setTooltip(Y.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Dn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_LENGTH),this.setTooltip(Y.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_DELDICT),this.setTooltip(Y.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pn={init:function(){this.MODE=[[Y.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Y.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Y.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Y.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Y.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Y.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Bn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setTooltip(Y.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Vn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Un={init:function(){this.setColour(vn),this.appendDummyInput("").appendField(new Y.FieldLabel(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Y.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Yn={init:function(){this.setColour(vn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},jn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_TO_JSON),this.setTooltip(Y.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gn={init:function(){this.setColour(vn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xn={init:function(){this.setColour(vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hn=210,qn={init:function(){var t=Y.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Y.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Y.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},zn={init:function(){var t=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Y.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Wn={init:function(){var t=[[Y.Msg.LOGIC_OPERATION_AND,"AND"],[Y.Msg.LOGIC_OPERATION_OR,"OR"],[Y.Msg.LOGIC_OPERATION_NOR,"NOR"],[Y.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Y.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Y.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Jn={init:function(){this.setColour(Hn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Y.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Y.Msg.LOGIC_NEGATE_TOOLTIP)}},Kn={init:function(){var t=[[Y.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Y.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Hn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Y.FieldDropdown(t),"BOOL"),this.setTooltip(Y.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Qn={init:function(){this.setColour(Hn),this.setOutput(!0),this.appendDummyInput().appendField(Y.Msg.LOGIC_NULL),this.setTooltip(Y.Msg.LOGIC_NULL_TOOLTIP)}},Zn={init:function(){this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Y.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Y.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},ti={init:function(){var t=[[Y.Msg.TEXT_APPEND_TO,"in"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Y.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Y.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.IN)}},ei={init:function(){var t=[[Y.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},ni={init:function(){this.setColour(Hn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},ii={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Y.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},si={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ri={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},oi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXPY_TEXT_ENCODE).appendField(new Y.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},ai={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},li={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ui={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},ci={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},pi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.HTML_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},hi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},_i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},di={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const fi={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},gi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},Si={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},ki={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Y.Msg.MIXLY_ESP32_SET+{mkdir:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},yi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Y.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Ti={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.HTML_FILE,"isfile"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},$i={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Y.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_SETUP+Y.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Y.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Y.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Ei={init:function(){var t=q.findLegalName("",this),e=new Y.FieldTextInput(t,q.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new Y.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Y.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Y.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Y.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Y.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(Y.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=Y.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Y.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{Y.Events.enable()}},mutationToDom:function(t){var e=Y.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ks={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_FORM_CONTENT).appendField(new Y.FieldDropdown([[Y.Msg.HTML_TEXT,"text"],[Y.Msg.HTML_EMAIL,"email"],[Y.Msg.HTML_NUMBER,"number"],[Y.Msg.HTML_PASSWORD,"password"],[Y.Msg.HTML_CHECKBOX,"checkbox"],[Y.Msg.HTML_RADIOBUTTON,"radiobutton"],[Y.Msg.HTML_BUTTON,"button"],[Y.Msg.HTML_COLOUR,"colour"],[Y.Msg.HTML_DATE,"date"],[Y.Msg.HTML_LOCALTIME,"local time"],[Y.Msg.HTML_FILE,"file"],[Y.Msg.HTML_HIDDEN,"hidden"],[Y.Msg.HTML_IMAGE,"image"],[Y.Msg.HTML_MONTH,"month"],[Y.Msg.HTML_RANGE,"range"],[Y.Msg.HTML_RESET,"reset"],[Y.Msg.HTML_SEARCH,"search"],[Y.Msg.HTML_SUBMIT,"submit"],[Y.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Y.Msg.HTML_TIME,"time"],[Y.Msg.HTML_URL,"url"],[Y.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Y.Msg.HTML_NAME).appendField(new Y.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Y.Msg.HTML_VALUE).appendField(new Y.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ys={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ts={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vs={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Y.Msg.HTML_TEXT).appendField(new Y.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$s=160,ws={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Y.FieldTable(""),"TEXT")}},Es={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT")}},Is={init:function(){this.setColour($s),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},As={init:function(){this.setColour($s),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Os={init:function(){this.setColour($s),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Y.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ms={init:function(){this.setColour($s),this.appendValueInput("VALUE").appendField(Y.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Cs={init:function(){this.setColour($s),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Y.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$o={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(uo),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_SPLITBYDOU).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Io={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Ao={init:function(){this.setColour(uo);var t=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],e=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Oo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Mo={init:function(){this.setColour(uo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Co={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ro={init:function(){this.setColour(uo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},No={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(uo),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Y.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setTooltip(Y.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Lo={init:function(){this.setColour(uo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Do={init:function(){this.setColour(uo),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Y.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Fo={init:function(){this.setColour(uo),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Y.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Y.FieldDropdown([[Y.Msg.DATAFRAME_COLUMN,"column"],[Y.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Y.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Po={init:function(){this.setColour(uo),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Bo={init:function(){this.setColour(uo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},Vo={init:function(){this.setColour(uo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},Uo={init:function(){this.setColour(uo),this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Yo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Go={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xo={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ho={init:function(){this.setColour(uo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qo={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zo={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Wo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Jo={init:function(){this.setColour(uo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ko={init:function(){this.setColour(uo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Qo={init:function(){this.setColour(uo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Zo={init:function(){this.setColour(uo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ta={init:function(){this.setColour(uo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},ea={init:function(){this.setColour(uo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},na={init:function(){this.setColour(uo),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ia={init:function(){this.setColour(uo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},sa=20,ra={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Y.Msg.INOUT_input_TOOLTIP)}},oa={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.BLOCKPY_PRINT_TOOLTIP)}},aa={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},la={init:function(){this.setColour(sa),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Y.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},ua={init:function(){var t=[[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(sa),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(Y.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:Y.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Y.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Y.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},ca={init:function(){this.setColour(sa),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},Y.isNumber(i)&&Y.isNumber(s)&&Y.isNumber(r))i=parseFloat(i),s=parseFloat(s),r=Math.abs(parseFloat(r)),0==i%1&&0==s%1&&0==r%1?(i<=s?(s++,t=0==i&&1==r?s:i+", "+s,1!=r&&(t+=", "+r)):t=i+", "+--s+", -"+r,t="range("+t+")"):(t=i",GTE:">="};const fp=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",r=e.valueToCode(this,"B",i)||"False";if("AND"==n)var o=s+" and "+r;else if("OR"==n)o=s+" or "+r;else if("NOR"==n)o="not("+s+"^"+r+")";else o=s+"^"+r;return[o,i]},mp=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},gp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},bp=function(t,e){return["None",e.ORDER_ATOMIC]},Sp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},kp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},yp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Tp=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},vp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},$p=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},wp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Ep=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Ip=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},Ap=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Op=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Mp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Cp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Rp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},xp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Np=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Lp=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Dp=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Fp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Pp=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},Bp=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Vp=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Up=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Yp=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},jp=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},Gp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Xp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Hp=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),Y.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var r=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Eh=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},Ih=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},Ah=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Oh=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},Mh=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ch=function(t,e){return'"},Rh=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},xh=function(){return this.getFieldValue("TEXT")+"\n"},Nh=function(t){return t.getFieldValue("TEXT")+"\n"},Lh=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Dh=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Fh=function(){return""},Ph=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Bh=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),r=0;r6:\n print("路线错乱!程序有误!")\n exit()\n'},i_=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},s_=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},r_=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},o_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},a_=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},l_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},u_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},c_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},p_=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},h_=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},__=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},d_=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},f_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},m_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},g_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},b_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},S_=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},k_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},y_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},T_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},v_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},$_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},w_=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},E_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},I_=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},A_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},O_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},M_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},C_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},R_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},x_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},N_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},L_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},D_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},F_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},P_=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},B_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},V_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},U_=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if athis.#t.on("display",t)[0],_m.configure({output:t=>{this.#t.run("output",{content:t})},read:this.readFile.bind(this),inputfun:this.skInput.bind(this),inputfunTakesPrompt:!0,execLimit:Number.POSITIVE_INFINITY,fileread:this.fileread.bind(this),filewrite:this.filewrite.bind(this),__future__:_m.python3}),_m.builtins.value=new _m.builtin.func((function(){return _m.ffi.remapToPy(void 0===fm?5:fm)})),_m.builtins.set_value=new _m.builtin.func((function(t){fm=t.v})),_m.builtinFiles.files["./mixpy.py"]='import math\r\n\r\ndef math_map(v, al, ah, bl, bh):\r\n return bl + (bh - bl) * (v - al) / (ah - al)\r\n\r\ndef math_mean(myList):\r\n localList = [e for e in myList if type(e) == int or type(e) == float]\r\n if not localList: return\r\n return float(sum(localList)) / len(localList)\r\n\r\ndef math_median(myList):\r\n localList = sorted([e for e in myList if type(e) == int or type(e) == float])\r\n if not localList: return\r\n if len(localList) % 2 == 0:\r\n return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0\r\n else:\r\n return localList[(len(localList) - 1) // 2]\r\n\r\ndef math_modes(some_list):\r\n modes = []\r\n # Using a lists of [item, count] to keep count rather than dict\r\n # to avoid "unhashable" errors when the counted item is itself a list or dict.\r\n counts = []\r\n maxCount = 1\r\n for item in some_list:\r\n found = False\r\n for count in counts:\r\n if count[0] == item:\r\n count[1] += 1\r\n maxCount = max(maxCount, count[1])\r\n found = True\r\n if not found:\r\n counts.append([item, 1])\r\n for counted_item, item_count in counts:\r\n if item_count == maxCount:\r\n modes.append(counted_item)\r\n return modes\r\n\r\ndef math_standard_deviation(numbers):\r\n n = len(numbers)\r\n if n == 0: return\r\n mean = float(sum(numbers)) / n\r\n variance = sum((x - mean) ** 2 for x in numbers) / n\r\n return math.sqrt(variance)\r\n\r\ndef lists_sort(my_list, type, reverse):\r\n def try_float(s):\r\n try:\r\n return float(s)\r\n except:\r\n return 0\r\n key_funcs = {\r\n "NUMERIC": try_float,\r\n "TEXT": str,\r\n "IGNORE_CASE": lambda s: str(s).lower()\r\n }\r\n key_func = key_funcs[type]\r\n list_cpy = list(my_list)\r\n return sorted(list_cpy, key=key_func, reverse=reverse)'}readFile(t){if(void 0!==dm[t])return _m.misceval.promiseToSuspension(fetch(dm[t]).then((t=>t.text())));if(void 0===_m.builtinFiles||void 0===_m.builtinFiles.files[t])throw"File not found: '"+t+"'";return _m.builtinFiles.files[t]}fileread(t,e){return this.mixpyProject.exist(t)?this.mixpyProject.getFileContent(t):-1!==e.indexOf("w")?(this.mixpyProject.add(t,"",1),""):null}filewrite(t,e){var n=t.name;this.mixpyProject.modify(n,e),this.mixpyProject.select(n)}skInput(t){return new Promise(((e,n)=>{this.#t.run("input",{content:{prompt:t},resolve:e,reject:n})}))}reset(){_m.execLimit=Number.POSITIVE_INFINITY,_m.TurtleGraphics.reset&&_m.TurtleGraphics.reset()}kill(){window.SPRITE.kill(),_m.execLimit=0,this.executionEnd_()}step(t,e,n,i){if(".py"==i){var s=this.executionBuffer.step,r=this.parseGlobals(t);this.executionBuffer.trace.push({step:s,filename:i,line:e,column:n,properties:r.properties,modules:r.modules}),this.executionBuffer.step=s+1,this.executionBuffer.last_step=s+1,this.executionBuffer.line_number=e}}analyzeVariables(){if(""==this.main.model.programs.__main__().trim())return{}}analyze(){return this.main.model.execution.status("analyzing"),""!=this.main.model.programs.__main__().trim()||(this.main.components.feedback.emptyProgram("You haven't written any code yet!"),!1)}run(t){this.reset(),-1===t.indexOf("import sprite")&&-1===t.indexOf("from sprite import")||window.SPRITE.runit(_m.TurtleGraphics.target),this.programStatus.running=!0,_m.misceval.asyncToPromise((()=>_m.importMainWithBody("",!1,t,!0))).then((()=>{window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("finished")})).catch((t=>{j.Debug.error(t),window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("error",t);var e=function(t){return"string"==typeof t?t:void 0!==t.tp$str?t.tp$str().v:t.name+": "+t.message}(t);this.#t.run("finished"),-1===e.indexOf("TimeLimitError")&&this.executionEnd_()}))}setupEnvironment(t,e,n,i,s){var r=this.main.model;this._backup_execution=_m.afterSingleExecution,_m.afterSingleExecution=void 0,_m.builtins.get_output=new _m.builtin.func((function(){return _m.builtin.pyCheckArgs("get_output",arguments,0,0),_m.ffi.remapToPy(r.execution.output())})),_m.builtins.reset_output=new _m.builtin.func((function(){_m.builtin.pyCheckArgs("reset_output",arguments,0,0),r.execution.output.removeAll()})),_m.builtins.log=new _m.builtin.func((function(t){_m.builtin.pyCheckArgs("log",arguments,1,1),console.log(t)})),_m.builtins._trace=e,_m.builtins._final_values=s,_m.builtins.code=_m.ffi.remapToPy(t),_m.builtins.set_success=this.instructor_module.set_success,_m.builtins.set_feedback=this.instructor_module.set_feedback,_m.builtins.set_finished=this.instructor_module.set_finished,_m.builtins.count_components=this.instructor_module.count_components,_m.builtins.no_nonlist_nums=this.instructor_module.no_nonlist_nums,_m.builtins.only_printing_properties=this.instructor_module.only_printing_properties,_m.builtins.calls_function=this.instructor_module.calls_function,_m.builtins.get_property=this.instructor_module.get_property,_m.builtins.get_value_by_name=this.instructor_module.get_value_by_name,_m.builtins.get_value_by_type=this.instructor_module.get_value_by_type,_m.builtins.parse_json=this.instructor_module.parse_json,_m.skip_drawing=!0,r.settings.mute_printer(!0)}disposeEnvironment(){_m.afterSingleExecution=this._backup_execution,_m.builtins.get_output=void 0,_m.builtins.reset_output=void 0,_m.builtins.log=void 0,_m.builtins._trace=void 0,_m.builtins.trace=void 0,_m.builtins.code=void 0,_m.builtins.set_success=void 0,_m.builtins.set_feedback=void 0,_m.builtins.set_finished=void 0,_m.builtins.count_components=void 0,_m.builtins.calls_function=void 0,_m.builtins.get_property=void 0,_m.builtins.get_value_by_name=void 0,_m.builtins.get_value_by_type=void 0,_m.builtins.no_nonlist_nums=void 0,_m.builtins.only_printing_properties=void 0,_m.builtins.parse_json=void 0,_m.skip_drawing=!1,fm=void 0,this.main.model.settings.mute_printer(!1)}parseGlobals(t){var e=Array(),n=Array();for(var i in t){var s=t[i];if("__name__"!==i&&"__doc__"!==i){i=i.replace("_$rw$","").replace("_$rn$","");var r=this.parseValue(i,s);null!==r?e.push(r):s.constructor==_m.builtin.module&&n.push(s.$d.__name__.v)}}return{properties:e,modules:n}}parseValue(t,e){if(null==e)return{name:t,type:"Unknown",value:"Undefined"};switch(e.constructor){case _m.builtin.func:return{name:t,type:"Function",value:void 0!==e.func_code.co_varnames?" Arguments: "+e.func_code.co_varnames.join(", "):" No arguments"};case _m.builtin.module:return null;case _m.builtin.str:return{name:t,type:"String",value:e.$r().v};case _m.builtin.none:return{name:t,type:"None",value:"None"};case _m.builtin.bool:return{name:t,type:"Boolean",value:e.$r().v};case _m.builtin.nmber:return{name:t,type:"int"==e.skType?"Integer":"Float",value:e.$r().v};case _m.builtin.int_:return{name:t,type:"Integer",value:e.$r().v};case _m.builtin.float_:return{name:t,type:"Float",value:e.$r().v};case _m.builtin.tuple:return{name:t,type:"Tuple",value:e.$r().v};case _m.builtin.list:return e.v.length<=20?{name:t,type:"List",value:e.$r().v,exact_value:e}:{name:t,type:"List",value:"[... "+e.v.length+" elements ...]",exact_value:e};case _m.builtin.dict:return{name:t,type:"Dictionary",value:e.$r().v};case Number:return{name:t,type:e%1==0?"Integer":"Float",value:e};case String:return{name:t,type:"String",value:e};case Boolean:return{name:t,type:"Boolean",value:e?"True":"False"};default:return{name:t,type:null==e.tp$name?e:e.tp$name,value:null==e.$r?e:e.$r().v}}}}const gm=$;var bm=n.n(gm);class Sm extends j.PageBase{static{j.HTMLTemplate.add("html/statusbar/statusbar-image.html",new j.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){j.StatusBarsManager.typesRegistry.register(["images"],Sm);const t=j.Workspace.getMain().getStatusBarsManager();t.add("images","images","图像"),t.changeTo("output")}}constructor(){super();const t=bm()(j.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,r=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(bm()(t.content.replace("overflow-y%3A%20hidden%3B",""))),r=this.getContent()[0].getElementsByTagName("iframe")[0],null==r)return;r.style.maxHeight=r.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(r.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(r);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const km=Sm;class ym{static{this.pythonShell=null,this.init=async function(){km.init(),this.pythonShell=new ym},this.run=function(){const t=j.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#n=null;#i=null;#s={row:0,column:0};#r="";#o=null;#a=null;#l=!1;#u=!1;#c=null;#p=()=>this.#h();#_=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#s.row){const t=this.#e.getEndPos();let e=this.#e.getValueRange(this.#s,t);return e=e.replace(this.#r,""),this.#o?.(e),this.#o=null,this.#a=null,this.#e.addValue("\n"),this.#d(),!0}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#u=!1,this.#e.addValue(`\n==${j.Msg.Lang["shell.finish"]}==`)})),t.bind("output",(t=>{this.#e.addValue(t.content)})),t.bind("error",(t=>{this.#u=!1,this.#e.addValue(`\n${t.toString()}\n`)})),t.bind("input",(t=>{const e=String(t?.content?.prompt);this.#e.addValue(`>>> ${e}`),this.#r=e,this.#o=t.resolve,this.#a=t.reject,this.#m()})),t.bind("display",(t=>{this.#i.changeTo("images"),this.#n.display(t)}))}#h(){const t=this.#e.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.rowsetTimeout(e,t)))}}const Tm=ym,vm={init:function(){Tm.init();const t=j.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Y.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{Tm.run().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Y.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{Tm.stop().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:5})}};vm.init(),Object.assign(Y.Variables,X),Object.assign(Y.Procedures,q),Y.Python=J,Y.generator=J,j.Profile.default={},Object.assign(Y.Blocks,t,e,i,s,r,o,a,l,u,c,p,h,_,d,f,m,g,b,S,k),Object.assign(Y.Python.forBlock,y,T,v,w,E,I,A,O,M,C,R,x,N,L,D,F,P,B,V,U)})()})(); \ No newline at end of file diff --git a/boards/default/python_skulpt_car/main.bundle.js b/boards/default/python_skulpt_car/main.bundle.js index 63948ed4..aa532cbc 100644 --- a/boards/default/python_skulpt_car/main.bundle.js +++ b/boards/default/python_skulpt_car/main.bundle.js @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class w{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new k.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(k.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},at={init:function(){this.setColour(nt),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},lt={init:function(){this.setColour(nt),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Tt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(nt);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},It={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};rt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],dt.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Et={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Rt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},At={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:nt,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},gt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Lt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(nt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Pt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ft={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ft={init:function(){this.setColour(nt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(k.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},vt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Vt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},bt={init:function(){this.setColour(vt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(vt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ut={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Xt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Bt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(vt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},xt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Gt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},wt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(vt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ht={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(vt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Wt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(vt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},qt={init:function(){this.setColour(vt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Qt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Jt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"],[k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_INT,"bti"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Zt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},zt=Kt,$t={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},te={init:function(){this.setColour(vt),this.itemCount_=1,this.setMutator(new k.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(k.Msg.MIXLY_PRODUCT+k.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(k.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(k.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const se={init:function(){this.setColour(ee),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},oe={init:function(){this.setColour(ee),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},_e={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pe={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ue={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ae={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},le={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},re={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},Te={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},de={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Ie={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},he={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ee={init:function(){this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},Oe={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Me={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ce={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Re={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ae={init:function(){this.setColour(ee),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ge={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ee),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ce={init:function(){this.setColour(ee),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ci={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ri={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},mi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},gi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Ci={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Li={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Si={init:function(){this.setColour(Oi),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ni={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Vi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Yi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},yi={init:function(){this.setColour(Oi),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bi={init:function(){this.setColour(Oi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ui={init:function(){this.setColour(Oi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Bi=210,xi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Gi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},wi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Hi={init:function(){this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Wi={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ki={init:function(){this.setColour(Bi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},ji={init:function(){this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},qi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Qi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ji={init:function(){this.setColour(Bi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Zi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$i={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},tn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},en={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},an={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const ln={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},dn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},In={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},cn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},mn={init:function(){var t=G.findLegalName("",this),e=new k.FieldTextInput(t,G.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Is={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},hs={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(us),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Os={init:function(){this.setColour(us),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ms={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cs=160,Rs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ms={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},As={init:function(){this.setColour(cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},gs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Cs={init:function(){this.setColour(cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ls={init:function(){this.setColour(cs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ss={init:function(){this.setColour(cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Vs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Js={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Zs={init:function(){this.setColour(Vs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},zs={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$s={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},to={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},eo={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},io={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},no={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Vs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},so={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},oo={init:function(){this.setColour(Vs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_o={init:function(){this.setColour(Vs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},po={init:function(){this.setColour(Vs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},uo={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},ao={init:function(){this.setColour(Vs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},lo={init:function(){this.setColour(Vs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Io={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ho={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Mo={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},co={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},mo={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ao={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},go={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Co={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Lo={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},So={init:function(){this.setColour(Vs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Do={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},No=20,Po={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},vo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Vo={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(No),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Yo={init:function(){this.setColour(No),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},$_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField("设置路径样式为"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},tp={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},ep={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField("在("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")放置").appendField(new k.FieldDropdown([["障碍","'wall'"],["金币","'coin'"]]),"item"),this.setTooltip("")}},ip={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},np={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField("初始化角色为"),this.appendDummyInput().appendField("面朝").appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},sp={init:function(){this.setColour(290),this.appendDummyInput().appendField("获取⻆⾊所获分数"),this.setOutput(!0,Number),this.setTooltip("")}},op={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.appendDummyInput().appendField("侧有障碍"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},_p={init:function(){this.appendDummyInput().appendField("随机生成小车油量"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},pp={init:function(){this.appendDummyInput().appendField("需要加油"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},up={init:function(){this.appendDummyInput().appendField("信号灯为绿灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap={init:function(){this.appendDummyInput().appendField("信号灯为红灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},lp={init:function(){this.appendDummyInput().appendField("进加油站加油"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},rp={init:function(){this.appendDummyInput().appendField("检查程序循环数目是否正确"),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},Tp=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},dp=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},Ip=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},hp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Ep=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},Op=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},Mp=function(t,e){for(var i=new Array(this.itemCount_),n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+u()+"("+t+", "+e+", "+i+") or "+a()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const qa=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Qa=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Ja=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Za=function(t,e){return["None",e.ORDER_ATOMIC]},za=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},$a=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},tl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},el=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},il=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},nl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},sl=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ol=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},_l=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},pl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ul=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},al=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ll=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},rl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Tl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},dl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Il=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},El=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ol=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ml=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Rl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ml=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Al=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},gl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Cl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ll=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},or=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},_r=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},pr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},ur=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ar=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lr=function(t,e){return'"},rr=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Tr=function(){return this.getFieldValue("TEXT")+"\n"},dr=function(t){return t.getFieldValue("TEXT")+"\n"},Ir=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},hr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Er=function(){return""},Or=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Mr=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new k.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(k.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},at={init:function(){this.setColour(nt),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},lt={init:function(){this.setColour(nt),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Tt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(nt);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},It={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};rt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],dt.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Et={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Rt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},At={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:nt,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},gt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Lt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(nt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Pt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ft={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ft={init:function(){this.setColour(nt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(k.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},vt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Vt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},bt={init:function(){this.setColour(vt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(vt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ut={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Xt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Bt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(vt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},xt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Gt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},wt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(vt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ht={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(vt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Wt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(vt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},qt={init:function(){this.setColour(vt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Qt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Jt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"],[k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_INT,"bti"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Zt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},zt=Kt,$t={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},te={init:function(){this.setColour(vt),this.itemCount_=1,this.setMutator(new k.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(k.Msg.MIXLY_PRODUCT+k.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(k.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(k.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const se={init:function(){this.setColour(ee),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},oe={init:function(){this.setColour(ee),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},_e={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pe={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ue={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ae={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},le={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},re={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},Te={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},de={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Ie={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},he={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ee={init:function(){this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},Oe={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Me={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ce={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Re={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ae={init:function(){this.setColour(ee),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ge={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ee),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ce={init:function(){this.setColour(ee),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ci={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ri={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},mi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},gi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Ci={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Li={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Si={init:function(){this.setColour(Oi),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ni={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Vi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Yi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},yi={init:function(){this.setColour(Oi),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bi={init:function(){this.setColour(Oi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ui={init:function(){this.setColour(Oi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Bi=210,xi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Gi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},wi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Hi={init:function(){this.setColour(Bi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Wi={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Bi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ki={init:function(){this.setColour(Bi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},ji={init:function(){this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},qi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Qi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Bi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ji={init:function(){this.setColour(Bi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Zi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$i={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},tn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},en={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},an={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const ln={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},dn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},In={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},cn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},mn={init:function(){var t=G.findLegalName("",this),e=new k.FieldTextInput(t,G.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Is={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},hs={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(us),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Os={init:function(){this.setColour(us),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ms={init:function(){this.setColour(us),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cs=160,Rs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ms={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},As={init:function(){this.setColour(cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},gs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Cs={init:function(){this.setColour(cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ls={init:function(){this.setColour(cs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ss={init:function(){this.setColour(cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Vs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Js={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Zs={init:function(){this.setColour(Vs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},zs={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$s={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},to={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},eo={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},io={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},no={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Vs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},so={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},oo={init:function(){this.setColour(Vs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_o={init:function(){this.setColour(Vs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},po={init:function(){this.setColour(Vs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},uo={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},ao={init:function(){this.setColour(Vs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},lo={init:function(){this.setColour(Vs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Io={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ho={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Mo={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},co={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},mo={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ao={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},go={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Co={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Lo={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},So={init:function(){this.setColour(Vs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Do={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},No=20,Po={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},vo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Vo={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(No),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Yo={init:function(){this.setColour(No),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},$_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField("设置路径样式为"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},tp={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},ep={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField("在("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")放置").appendField(new k.FieldDropdown([["障碍","'wall'"],["金币","'coin'"]]),"item"),this.setTooltip("")}},ip={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},np={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField("初始化角色为"),this.appendDummyInput().appendField("面朝").appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},sp={init:function(){this.setColour(290),this.appendDummyInput().appendField("获取⻆⾊所获分数"),this.setOutput(!0,Number),this.setTooltip("")}},op={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.appendDummyInput().appendField("侧有障碍"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},_p={init:function(){this.appendDummyInput().appendField("随机生成小车油量"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},pp={init:function(){this.appendDummyInput().appendField("需要加油"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},up={init:function(){this.appendDummyInput().appendField("信号灯为绿灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap={init:function(){this.appendDummyInput().appendField("信号灯为红灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},lp={init:function(){this.appendDummyInput().appendField("进加油站加油"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},rp={init:function(){this.appendDummyInput().appendField("检查程序循环数目是否正确"),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},Tp=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},dp=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},Ip=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},hp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Ep=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},Op=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},Mp=function(t,e){for(var i=new Array(this.itemCount_),n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+u()+"("+t+", "+e+", "+i+") or "+a()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const qa=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Qa=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Ja=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Za=function(t,e){return["None",e.ORDER_ATOMIC]},za=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},$a=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},tl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},el=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},il=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},nl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},sl=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ol=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},_l=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},pl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ul=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},al=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ll=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},rl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Tl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},dl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Il=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},El=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Ol=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Ml=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Rl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ml=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Al=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},gl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Cl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Ll=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},or=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},_r=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},pr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},ur=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ar=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},lr=function(t,e){return'"},rr=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Tr=function(){return this.getFieldValue("TEXT")+"\n"},dr=function(t){return t.getFieldValue("TEXT")+"\n"},Ir=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},hr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Er=function(){return""},Or=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Mr=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new k.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(k.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour(nt),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},lt={init:function(){this.setColour(nt),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Tt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},It={init:function(){this.setColour(nt);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};rt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],It.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Et={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Rt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},At={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:nt,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},gt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Lt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(nt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Pt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ft={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ft={init:function(){this.setColour(nt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(k.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},vt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Vt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},bt={init:function(){this.setColour(vt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(vt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Xt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Ut={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Gt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(vt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Bt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},xt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},wt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(vt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ht={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(vt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Wt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(vt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},qt={init:function(){this.setColour(vt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Qt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Jt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"],[k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_INT,"bti"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Zt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},zt=Kt,$t={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},te={init:function(){this.setColour(vt),this.itemCount_=1,this.setMutator(new k.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(k.Msg.MIXLY_PRODUCT+k.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(k.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(k.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const se={init:function(){this.setColour(ee),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},oe={init:function(){this.setColour(ee),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},_e={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pe={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ae={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ue={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},le={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},re={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},Te={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ie={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},de={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},he={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ee={init:function(){this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},Oe={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Me={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ce={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Re={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ae={init:function(){this.setColour(ee),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ge={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ee),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Le={init:function(){this.setColour(ee),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ci={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ri={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},mi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},gi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Li={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ci={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Si={init:function(){this.setColour(Oi),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ni={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Vi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Yi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},yi={init:function(){this.setColour(Oi),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bi={init:function(){this.setColour(Oi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi={init:function(){this.setColour(Oi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ui={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gi=210,Bi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},xi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},wi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Hi={init:function(){this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Wi={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ki={init:function(){this.setColour(Gi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},ji={init:function(){this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},qi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Qi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ji={init:function(){this.setColour(Gi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Zi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$i={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},tn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},en={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},un={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const ln={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},dn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},cn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},mn={init:function(){var t=x.findLegalName("",this),e=new k.FieldTextInput(t,x.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ds={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},hs={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(as),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Os={init:function(){this.setColour(as),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ms={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cs=160,Rs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ms={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},As={init:function(){this.setColour(cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},gs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ls={init:function(){this.setColour(cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Cs={init:function(){this.setColour(cs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ss={init:function(){this.setColour(cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Vs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Js={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Zs={init:function(){this.setColour(Vs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},zs={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$s={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},to={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},eo={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},io={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},no={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Vs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},so={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},oo={init:function(){this.setColour(Vs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_o={init:function(){this.setColour(Vs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},po={init:function(){this.setColour(Vs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ao={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},uo={init:function(){this.setColour(Vs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},lo={init:function(){this.setColour(Vs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Io={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ho={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Mo={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},co={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},mo={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ao={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},go={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Co={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},So={init:function(){this.setColour(Vs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Do={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},No=20,Po={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},vo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Vo={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(No),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Yo={init:function(){this.setColour(No),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},Z_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField(k.Msg.MIXLY_GAME_SETPATHTYPE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},z_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},$_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.MIXLY_GAME_LAY).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_WALL,"'wall'"],[k.Msg.MIXLY_GAME_BARRIER,"'barrier'"],[k.Msg.MIXLY_GAME_COIN,"'coin'"],[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"item"),this.setTooltip("")}},tp={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},ep={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField(k.Msg.MIXLY_GAME_INIT_CHARA),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_FACE+k.Msg.MIXLY_GAME_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ip={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GETPOINT),this.setOutput(!0,Number),this.setTooltip("")}},np={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_UP,"0"],[k.Msg.MIXLY_GAME_DOWN,"2"],[k.Msg.MIXLY_GAME_LEFT,"3"],[k.Msg.MIXLY_GAME_RIGHT,"1"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},sp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_RE_SPIRITE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_FORWARD,"f"],[k.Msg.MIXLY_GAME_BACKWARD,"b"],[k.Msg.MIXLY_GAME_LEFT,"l"],[k.Msg.MIXLY_GAME_RIGHT,"r"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},op={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_RANDOMCAROIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},_p={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NEEDOIL),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},pp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISGREEN),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ADDOIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},up={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECKCIRCURIGHT),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},lp={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECK_WHETHER_PASS),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField("?"),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},rp={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GET_MARKER_NUM),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NUMBER_OF_MARKER),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Tp={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.TEXT_GET_INDEX_RANDOM+k.Msg.MIXLY_GAME_LAY+k.Msg.MIXLY_GAME_BARRIER),this.setTooltip("")}},Ip={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_INIT_AS).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_ONE,"0"],[k.Msg.MIXLY_GAME_TWO,"1"],[k.Msg.MIXLY_GAME_THREE,"2"],[k.Msg.MIXLY_GAME_FOUR,"3"],[k.Msg.MIXLY_GAME_FIVE,"4"],[k.Msg.MIXLY_GAME_SIX,"5"],[k.Msg.MIXLY_GAME_SEVEN,"6"],[k.Msg.MIXLY_GAME_EIGHT,"7"],[k.Msg.MIXLY_GAME_NINE,"8"],[k.Msg.MIXLY_GAME_TEN,"9"],[k.Msg.MIXLY_GAME_ELE,"10"],[k.Msg.MIXLY_GAME_TWEL,"11"],[k.Msg.MIXLY_GAME_THIR,"12"],[k.Msg.MIXLY_GAME_FORT,"13"],[k.Msg.MIXLY_GAME_FIFT,"14"],[k.Msg.MIXLY_GAME_SIXT,"15"],[k.Msg.MIXLY_GAME_SEVENT,"16"]]),"level"),this.setInputsInline(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},dp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("二分法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},hp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("顺序法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},Ep=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},Op=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},Mp=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},cp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Rp=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},mp=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},Ap=function(t,e){for(var i=new Array(this.itemCount_),n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const zu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},$u=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},tl=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},el=function(t,e){return["None",e.ORDER_ATOMIC]},il=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},nl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ol=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},_l=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},al=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ul=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ll=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},rl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Tl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Il=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},hl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},El=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ol=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ml=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Rl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ml=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Al=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},gl=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ll=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Cl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Sl=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Nl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Pl=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ur=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},lr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},rr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Tr=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ir=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},dr=function(t,e){return'"},hr=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Er=function(){return this.getFieldValue("TEXT")+"\n"},Or=function(t){return t.getFieldValue("TEXT")+"\n"},Mr=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},cr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Rr=function(){return""},mr=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ar=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$={init:function(){this.setColour(K),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new k.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(k.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour(nt),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},lt={init:function(){this.setColour(nt),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Tt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},It={init:function(){this.setColour(nt);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};rt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],It.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Et={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Rt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},mt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},At={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:nt,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},gt={init:function(){this.setColour(nt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Lt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ct={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(nt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Dt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Pt={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},ft={init:function(){this.setColour(nt),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Ft={init:function(){this.setColour(nt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(k.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},vt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Vt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},yt={init:function(){this.setColour(vt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},bt={init:function(){this.setColour(vt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},kt={init:function(){this.setColour(vt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Xt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Ut={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Gt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(vt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Bt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},xt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(vt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},wt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(vt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ht={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(vt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Wt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Kt={init:function(){this.setColour(vt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},jt={init:function(){this.setColour(vt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},qt={init:function(){this.setColour(vt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Qt={init:function(){this.setColour(vt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Jt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"],[k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_INT,"bti"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Zt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(vt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},zt=Kt,$t={init:function(){this.setColour(vt),this.appendValueInput("VAR").appendField(k.Msg.LANG_MATH_BYTE+k.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},te={init:function(){this.setColour(vt),this.itemCount_=1,this.setMutator(new k.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(k.Msg.MIXLY_PRODUCT+k.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(k.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(k.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const se={init:function(){this.setColour(ee),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},oe={init:function(){this.setColour(ee),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},_e={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pe={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ae={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ue={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},le={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},re={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},Te={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Ie={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},de={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},he={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ee={init:function(){this.setColour(ee),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},Oe={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Me={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(ee),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ce={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Re={init:function(){this.setColour(ee),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},me={init:function(){this.setColour(ee),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ae={init:function(){this.setColour(ee),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ge={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ee),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Le={init:function(){this.setColour(ee),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ci={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ri={init:function(){this.setColour(Oi),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},mi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},gi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Li={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ci={init:function(){this.setColour(Oi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Si={init:function(){this.setColour(Oi),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ni={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vi={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Vi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Yi={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},yi={init:function(){this.setColour(Oi),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bi={init:function(){this.setColour(Oi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ki={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi={init:function(){this.setColour(Oi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Ui={init:function(){this.setColour(Oi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gi=210,Bi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},xi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},wi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Hi={init:function(){this.setColour(Gi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Wi={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Gi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ki={init:function(){this.setColour(Gi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},ji={init:function(){this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},qi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Qi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Gi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ji={init:function(){this.setColour(Gi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Zi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$i={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},tn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},en={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},pn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},un={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const ln={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},Tn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},In={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},dn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},hn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},En={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},On={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Mn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},cn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Rn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},mn={init:function(){var t=x.findLegalName("",this),e=new k.FieldTextInput(t,x.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ds={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},hs={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(as),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Os={init:function(){this.setColour(as),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ms={init:function(){this.setColour(as),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cs=160,Rs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ms={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},As={init:function(){this.setColour(cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},gs={init:function(){this.setColour(cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ls={init:function(){this.setColour(cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Cs={init:function(){this.setColour(cs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ss={init:function(){this.setColour(cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ws={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ks={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},js={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Vs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Js={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Zs={init:function(){this.setColour(Vs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},zs={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$s={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},to={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},eo={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},io={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},no={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Vs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},so={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},oo={init:function(){this.setColour(Vs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_o={init:function(){this.setColour(Vs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},po={init:function(){this.setColour(Vs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ao={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},uo={init:function(){this.setColour(Vs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},lo={init:function(){this.setColour(Vs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},To={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Io={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ho={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Vs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Mo={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},co={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ro={init:function(){this.setColour(Vs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},mo={init:function(){this.setColour(Vs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ao={init:function(){this.setColour(Vs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},go={init:function(){this.setColour(Vs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lo={init:function(){this.setColour(Vs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Co={init:function(){this.setColour(Vs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},So={init:function(){this.setColour(Vs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Do={init:function(){this.setColour(Vs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},No=20,Po={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Fo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},vo={init:function(){this.setColour(No),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Vo={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(No),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Yo={init:function(){this.setColour(No),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},Z_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField(k.Msg.MIXLY_GAME_SETPATHTYPE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},z_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},$_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.MIXLY_GAME_LAY).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_WALL,"'wall'"],[k.Msg.MIXLY_GAME_BARRIER,"'barrier'"],[k.Msg.MIXLY_GAME_COIN,"'coin'"],[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"item"),this.setTooltip("")}},tp={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},ep={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField(k.Msg.MIXLY_GAME_INIT_CHARA),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_FACE+k.Msg.MIXLY_GAME_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ip={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GETPOINT),this.setOutput(!0,Number),this.setTooltip("")}},np={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_UP,"0"],[k.Msg.MIXLY_GAME_DOWN,"2"],[k.Msg.MIXLY_GAME_LEFT,"3"],[k.Msg.MIXLY_GAME_RIGHT,"1"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},sp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_RE_SPIRITE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_FORWARD,"f"],[k.Msg.MIXLY_GAME_BACKWARD,"b"],[k.Msg.MIXLY_GAME_LEFT,"l"],[k.Msg.MIXLY_GAME_RIGHT,"r"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},op={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_RANDOMCAROIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},_p={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NEEDOIL),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},pp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISGREEN),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ADDOIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},up={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECKCIRCURIGHT),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},lp={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECK_WHETHER_PASS),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField("?"),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},rp={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GET_MARKER_NUM),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NUMBER_OF_MARKER),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Tp={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.TEXT_GET_INDEX_RANDOM+k.Msg.MIXLY_GAME_LAY+k.Msg.MIXLY_GAME_BARRIER),this.setTooltip("")}},Ip={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_INIT_AS).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_ONE,"0"],[k.Msg.MIXLY_GAME_TWO,"1"],[k.Msg.MIXLY_GAME_THREE,"2"],[k.Msg.MIXLY_GAME_FOUR,"3"],[k.Msg.MIXLY_GAME_FIVE,"4"],[k.Msg.MIXLY_GAME_SIX,"5"],[k.Msg.MIXLY_GAME_SEVEN,"6"],[k.Msg.MIXLY_GAME_EIGHT,"7"],[k.Msg.MIXLY_GAME_NINE,"8"],[k.Msg.MIXLY_GAME_TEN,"9"],[k.Msg.MIXLY_GAME_ELE,"10"],[k.Msg.MIXLY_GAME_TWEL,"11"],[k.Msg.MIXLY_GAME_THIR,"12"],[k.Msg.MIXLY_GAME_FORT,"13"],[k.Msg.MIXLY_GAME_FIFT,"14"],[k.Msg.MIXLY_GAME_SIXT,"15"],[k.Msg.MIXLY_GAME_SEVENT,"16"]]),"level"),this.setInputsInline(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},dp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("二分法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},hp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("顺序法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},Ep=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},Op=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},Mp=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},cp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Rp=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},mp=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},Ap=function(t,e){for(var i=new Array(this.itemCount_),n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const zu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},$u=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},tl=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},el=function(t,e){return["None",e.ORDER_ATOMIC]},il=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},nl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},sl=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ol=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},_l=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},al=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},ul=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ll=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},rl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Tl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Il=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},dl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},hl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},El=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Ol=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Ml=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Rl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},ml=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Al=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},gl=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ll=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Cl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Sl=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Nl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Pl=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ur=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},lr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},rr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Tr=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Ir=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},dr=function(t,e){return'"},hr=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Er=function(){return this.getFieldValue("TEXT")+"\n"},Or=function(t){return t.getFieldValue("TEXT")+"\n"},Mr=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},cr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Rr=function(){return""},mr=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Ar=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s