Files
mixly3/boards/default/micropython_nrf51822_microbit/main.bundle.b76ac301.js

21 lines
421 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{controls_type:()=>_t,controls_typeLists:()=>ut,lists_zip:()=>rt,lists_zip_container:()=>pt,lists_zip_item:()=>at,unpack_iterable_object:()=>lt,variables_change:()=>st,variables_get:()=>it,variables_global:()=>ot,variables_set:()=>nt});var i={};t.r(i),t.d(i,{base_setup:()=>Tt,controls_delay:()=>ht,controls_end_program:()=>Mt,controls_except:()=>Nt,controls_finally:()=>Pt,controls_flow_statements:()=>gt,controls_for:()=>Ct,controls_forEach:()=>ct,controls_for_range:()=>At,controls_if:()=>mt,controls_if_else:()=>ft,controls_if_elseif:()=>St,controls_if_if:()=>Lt,controls_lambda:()=>vt,controls_main:()=>dt,controls_pass:()=>Yt,controls_range:()=>Ot,controls_repeat_ext:()=>Ft,controls_thread:()=>bt,controls_try:()=>Dt,controls_try_finally:()=>Rt,controls_whileUntil:()=>Et,datetime_fromtimestamp:()=>Ut,do_while:()=>Xt,garbage_collection:()=>yt,gene_unique_identifier:()=>wt,get_mem_alloc:()=>Vt,get_mem_free:()=>Bt,get_unique_identifier:()=>Gt});var n={};t.r(n),t.d(n,{base_map:()=>re,generate_cartesian_product:()=>ae,math_arithmetic:()=>Kt,math_bit:()=>Qt,math_constant:()=>Ht,math_constant_mp:()=>Wt,math_constrain:()=>ee,math_dec:()=>qt,math_degree_to_radian:()=>Ie,math_indexer_number:()=>ne,math_map:()=>ie,math_max_min:()=>Zt,math_number:()=>xt,math_number_base_conversion:()=>$t,math_radian_to_degree:()=>le,math_random:()=>te,math_random_seed:()=>se,math_round:()=>oe,math_selfcalcu:()=>Jt,math_to_int:()=>zt,math_trig:()=>jt,text_to_number:()=>_e,text_to_number_skulpt:()=>ue,turn_to_int:()=>pe});var s={};t.r(s),t.d(s,{ascii_to_char:()=>ce,char_to_ascii:()=>Ee,number_to_text:()=>Re,os_system:()=>Ke,text:()=>Te,text_bytes:()=>Me,text_capital:()=>Pe,text_center:()=>Fe,text_char:()=>me,text_char_at:()=>Ae,text_char_at2:()=>Ce,text_char_at3:()=>ke,text_compareTo:()=>we,text_compare_to:()=>Ne,text_create_with_container:()=>Be,text_create_with_item:()=>Ge,text_encode:()=>He,text_equals_starts_ends:()=>De,text_eval:()=>We,text_find:()=>ve,text_format:()=>Ve,text_format_noreturn:()=>xe,text_join:()=>Oe,text_join_seq:()=>Ye,text_length:()=>ge,text_random_char:()=>Le,text_replace:()=>be,text_split:()=>Xe,text_strip:()=>ye,text_substring:()=>fe,text_substring2:()=>Se,text_substring3:()=>Ue,text_textarea:()=>he});var o={};t.r(o),t.d(o,{ENUMERATE:()=>Di,content_in_lists:()=>Pi,enumerate:()=>Ni,list_many_input:()=>hi,list_tolist:()=>ci,list_tolist2:()=>fi,list_trig:()=>Ii,lists_2d_get_col_row_data:()=>ze,lists_2d_get_data_with_col_row:()=>qe,lists_append_extend:()=>ni,lists_change_to:()=>Ti,lists_change_to_general:()=>mi,lists_clear:()=>ri,lists_create_with:()=>Ze,lists_create_with2:()=>Ei,lists_create_with_container:()=>ti,lists_create_with_item:()=>ei,lists_create_with_noreturn:()=>Mi,lists_create_with_text:()=>$e,lists_create_with_text2:()=>Ri,lists_del_general:()=>Oi,lists_find:()=>li,lists_getIndex3:()=>gi,lists_getSublist3:()=>Ci,lists_get_index:()=>Qe,lists_get_random_item:()=>si,lists_get_random_sublist:()=>oi,lists_get_sublist:()=>je,lists_insert_value:()=>_i,lists_insert_value2:()=>Li,lists_pop:()=>ai,lists_remove_at:()=>pi,lists_remove_at2:()=>Si,lists_reverse:()=>ui,lists_setIndex3:()=>Ai,lists_set_index:()=>ii,lists_sort:()=>di});var _={};t.r(_),t.d(_,{dicts_add_change_del:()=>Ki,dicts_add_or_change:()=>Bi,dicts_clear:()=>wi,dicts_create_with:()=>vi,dicts_create_with_container:()=>Yi,dicts_create_with_item:()=>bi,dicts_create_with_noreturn:()=>ji,dicts_deldict:()=>Wi,dicts_delete:()=>Gi,dicts_get:()=>yi,dicts_get_default:()=>Vi,dicts_items:()=>ki,dicts_keys:()=>Xi,dicts_length:()=>Hi,dicts_pop:()=>Ji,dicts_setdefault:()=>Qi,dicts_to_json:()=>zi,dicts_to_json2:()=>tn,dicts_to_to:()=>$i,dicts_todict:()=>qi,dicts_update:()=>Ui,dicts_values:()=>xi,json_to_dicts:()=>Zi});var u={};t.r(u),t.d(u,{logic_boolean:()=>un,logic_compare:()=>nn,logic_compare_continous:()=>sn,logic_is:()=>ln,logic_is_in:()=>an,logic_negate:()=>_n,logic_null:()=>rn,logic_operation:()=>on,logic_tobool:()=>In,logic_true_or_false:()=>pn});var r={};t.r(r),t.d(r,{sdcard_mount:()=>Xn,sdcard_use_spi_init:()=>bn,storage_can_write_ornot:()=>Rn,storage_change_dir:()=>vn,storage_close_file:()=>Cn,storage_delete_file:()=>Ln,storage_file_seek:()=>Dn,storage_file_tell:()=>fn,storage_file_write:()=>mn,storage_fileopen:()=>Tn,storage_fileopen_new:()=>hn,storage_fileopen_new_encoding:()=>Mn,storage_get_a_line:()=>En,storage_get_contents:()=>cn,storage_get_contents_without_para:()=>On,storage_get_current_dir:()=>Nn,storage_get_file_size:()=>Sn,storage_get_filename:()=>gn,storage_is_file:()=>Yn,storage_list_all_files:()=>An,storage_make_dir:()=>Pn,storage_open_file_with_os:()=>dn,storage_rename:()=>Fn});var p={};t.r(p),t.d(p,{procedures_callnoreturn:()=>Un,procedures_callreturn:()=>wn,procedures_defnoreturn:()=>yn,procedures_defreturn:()=>Vn,procedures_ifreturn:()=>kn,procedures_mutatorarg:()=>Gn,procedures_mutatorcontainer:()=>Bn,procedures_return:()=>xn});var a={};t.r(a),t.d(a,{tuple_change_to:()=>es,tuple_create_llm_params:()=>as,tuple_create_with:()=>Wn,tuple_create_with_container:()=>Kn,tuple_create_with_item:()=>Jn,tuple_create_with_noreturn:()=>os,tuple_create_with_text2:()=>Qn,tuple_create_with_text_return:()=>jn,tuple_del:()=>Zn,tuple_find:()=>is,tuple_getIndex:()=>qn,tuple_getSublist:()=>ss,tuple_get_random_item:()=>us,tuple_get_sublist:()=>_s,tuple_input:()=>ps,tuple_join:()=>$n,tuple_length:()=>zn,tuple_max:()=>ts,tuple_totuple:()=>rs,tuple_trig:()=>ns});var l={};t.r(l),t.d(l,{set_add_discard:()=>Es,set_clear:()=>ms,set_create_with:()=>Is,set_create_with_container:()=>ds,set_create_with_item:()=>Ts,set_create_with_text_return:()=>Cs,set_length:()=>hs,set_operate:()=>Os,set_operate_update:()=>cs,set_pop:()=>Ms,set_sub:()=>Rs,set_toset:()=>As,set_update:()=>gs});var I={};t.r(I),t.d(I,{html_content:()=>Ns,html_content_more:()=>Ps,html_document:()=>Ss,html_form:()=>vs,html_head_body:()=>Ds,html_style:()=>Fs,html_style_color:()=>bs,html_style_content:()=>Ys,html_text:()=>Xs,html_title:()=>fs});var d={};t.r(d),t.d(d,{attribute_access:()=>js,function_call:()=>Ks,function_call_container:()=>Js,function_call_item:()=>Qs,raw_block:()=>Bs,raw_empty:()=>Us,raw_expression:()=>Gs,raw_table:()=>Vs,text_comment:()=>ws,text_print_multiple:()=>xs,text_print_multiple_container:()=>Hs,text_print_multiple_item:()=>Ws,type_check:()=>ks});var T={};t.r(T),t.d(T,{controls_type:()=>to,controls_typeLists:()=>eo,lists_zip:()=>io,unpack_iterable_object:()=>no,variables_change:()=>Zs,variables_get:()=>qs,variables_global:()=>$s,variables_set:()=>zs});var h={};t.r(h),t.d(h,{Panic_with_status_code:()=>To,base_setup:()=>oo,controls_delay:()=>Io,controls_flow_statements:()=>lo,controls_for:()=>ro,controls_forEach:()=>co,controls_for_range:()=>po,controls_if:()=>_o,controls_interrupts:()=>mo,controls_lambda:()=>Ro,controls_main:()=>so,controls_millis:()=>ho,controls_nointerrupts:()=>Oo,controls_pass:()=>Co,controls_range:()=>Eo,controls_repeat:()=>Fo,controls_repeat_ext:()=>So,controls_thread:()=>Ao,controls_try_finally:()=>uo,controls_whileUntil:()=>ao,datetime_fromtimestamp:()=>vo,do_while:()=>Lo,garbage_collection:()=>fo,gene_unique_identifier:()=>Yo,get_mem_alloc:()=>Do,get_mem_free:()=>No,get_unique_identifier:()=>Po,reset:()=>Mo,time_sleep:()=>go});var M={};t.r(M),t.d(M,{base_map:()=>t_,generate_cartesian_product:()=>i_,math_arithmetic:()=>Bo,math_bit:()=>Vo,math_constant:()=>Xo,math_constant_mp:()=>yo,math_constrain:()=>Jo,math_dec:()=>ko,math_degree_to_radian:()=>s_,math_indexer_number:()=>qo,math_map:()=>Ko,math_max_min:()=>Ho,math_number:()=>bo,math_number_base_conversion:()=>Qo,math_radian_to_degree:()=>n_,math_random:()=>Wo,math_random_seed:()=>jo,math_round:()=>zo,math_selfcalcu:()=>Go,math_single:()=>Uo,math_to_int:()=>xo,math_trig:()=>wo,text_to_number:()=>Zo,text_to_number_skulpt:()=>$o,turn_to_int:()=>e_});var m={};t.r(m),t.d(m,{ascii_to_char:()=>a_,char_to_ascii:()=>l_,number_to_text:()=>I_,os_system:()=>X_,text:()=>o_,text_bytes:()=>u_,text_capital:()=>R_,text_center:()=>g_,text_char:()=>r_,text_char_at:()=>h_,text_char_at2:()=>T_,text_char_at3:()=>v_,text_compareTo:()=>F_,text_compare_to:()=>O_,text_encode:()=>Y_,text_equals_starts_ends:()=>m_,text_eval:()=>b_,text_find:()=>C_,text_format:()=>D_,text_format_noreturn:()=>N_,text_join:()=>p_,text_join_seq:()=>A_,text_length:()=>d_,text_random_char:()=>M_,text_replace:()=>L_,text_split:()=>S_,text_strip:()=>f_,text_substring:()=>E_,text_substring2:()=>c_,text_substring3:()=>P_,text_textarea:()=>__});var O={};t.r(O),t.d(O,{content_in_lists:()=>hu,enumerate:()=>Tu,list_many_input:()=>eu,list_tolist:()=>Iu,list_tolist2:()=>du,list_trig:()=>Z_,lists_2d_get_col_row_data:()=>B_,lists_2d_get_data_with_col_row:()=>V_,lists_append_extend:()=>x_,lists_change_to:()=>tu,lists_change_to_general:()=>nu,lists_clear:()=>Q_,lists_create_with:()=>G_,lists_create_with2:()=>ou,lists_create_with_noreturn:()=>iu,lists_create_with_text:()=>U_,lists_create_with_text2:()=>_u,lists_del_general:()=>su,lists_find:()=>j_,lists_getIndex3:()=>uu,lists_getSublist3:()=>ru,lists_get_index:()=>w_,lists_get_random_item:()=>H_,lists_get_random_sublist:()=>W_,lists_get_sublist:()=>y_,lists_insert_value:()=>K_,lists_insert_value2:()=>au,lists_pop:()=>z_,lists_remove_at:()=>q_,lists_remove_at2:()=>lu,lists_reverse:()=>J_,lists_setIndex3:()=>pu,lists_set_index:()=>k_,lists_sort:()=>$_});var c={};t.r(c),t.d(c,{dicts_add_change_del:()=>Du,dicts_add_or_change:()=>Eu,dicts_clear:()=>Cu,dicts_create_with:()=>Mu,dicts_create_with_noreturn:()=>Fu,dicts_deldict:()=>fu,dicts_delete:()=>Ru,dicts_get:()=>Ou,dicts_get_default:()=>cu,dicts_items:()=>Au,dicts_keys:()=>mu,dicts_length:()=>Su,dicts_pop:()=>Nu,dicts_setdefault:()=>Pu,dicts_to_json:()=>Yu,dicts_to_json2:()=>yu,dicts_to_to:()=>Xu,dicts_todict:()=>vu,dicts_update:()=>gu,dicts_values:()=>Lu,json_to_dicts:()=>bu});var E={};t.r(E),t.d(E,{logic_boolean:()=>wu,logic_compare:()=>Vu,logic_compare_continous:()=>Bu,logic_is:()=>Wu,logic_is_in:()=>Hu,logic_negate:()=>Uu,logic_null:()=>ku,logic_operation:()=>Gu,logic_tobool:()=>Ku,logic_true_or_false:()=>xu});var R={};t.r(R),t.d(R,{sdcard_mount:()=>hr,sdcard_use_spi_init:()=>Tr,storage_can_write_ornot:()=>er,storage_change_dir:()=>pr,storage_close_file:()=>nr,storage_delete_file:()=>or,storage_file_seek:()=>rr,storage_file_tell:()=>ur,storage_file_write:()=>zu,storage_fileopen:()=>Qu,storage_fileopen_new:()=>ju,storage_fileopen_new_encoding:()=>qu,storage_get_a_line:()=>tr,storage_get_contents:()=>$u,storage_get_contents_without_para:()=>Zu,storage_get_current_dir:()=>ar,storage_get_file_size:()=>_r,storage_get_filename:()=>ir,storage_is_file:()=>dr,storage_list_all_files:()=>sr,storage_make_dir:()=>lr,storage_open_file_with_os:()=>Ju,storage_rename:()=>Ir});var g={};t.r(g),t.d(g,{procedures_callnoreturn:()=>cr,procedures_callreturn:()=>Or,procedures_defnoreturn:()=>mr,procedures_defreturn:()=>Mr,procedures_ifreturn:()=>Er,procedures_return:()=>Rr});var C={};t.r(C),t.d(C,{tuple_change_to:()=>Pr,tuple_create_llm_params:()=>Gr,tuple_create_with:()=>gr,tuple_create_with_noreturn:()=>br,tuple_create_with_text2:()=>Cr,tuple_create_with_text_return:()=>Ar,tuple_del:()=>fr,tuple_find:()=>Fr,tuple_getIndex:()=>Lr,tuple_getSublist:()=>Yr,tuple_get_random_item:()=>yr,tuple_get_sublist:()=>Xr,tuple_input:()=>Br,tuple_join:()=>Dr,tuple_length:()=>Sr,tuple_max:()=>Nr,tuple_totuple:()=>Vr,tuple_trig:()=>vr});var A={};t.r(A),t.d(A,{set_add_discard:()=>Kr,set_clear:()=>xr,set_create_with:()=>Ur,set_create_with_text_return:()=>jr,set_length:()=>wr,set_operate:()=>Hr,set_operate_update:()=>Wr,set_pop:()=>kr,set_sub:()=>Jr,set_toset:()=>qr,set_update:()=>Qr});var L={};t.r(L),t.d(L,{html_content:()=>tp,html_content_more:()=>ep,html_document:()=>zr,html_form:()=>np,html_head_body:()=>$r,html_style:()=>ip,html_style_content:()=>sp,html_text:()=>op,html_title:()=>Zr});var S={};t.r(S),t.d(S,{attribute_access:()=>Ip,function_call:()=>lp,raw_block:()=>_p,raw_empty:()=>rp,raw_expression:()=>up,raw_table:()=>pp,type_check:()=>ap});var f={};t.r(f),t.d(f,{educore_mqtt_connect:()=>Ca,educore_mqtt_connect_success:()=>fa,educore_mqtt_subscribe_message:()=>Aa,educore_mqtt_topic_publish:()=>Sa,educore_mqtt_topic_subscribe:()=>La,educore_wifi_connect:()=>ga,network_ap_connect:()=>ta,network_connect:()=>jp,network_get_connect:()=>zp,network_get_wifi:()=>$p,network_init:()=>Wp,network_is_active:()=>Jp,network_open:()=>Kp,network_scan:()=>Qp,network_server:()=>ea,network_socket_accept:()=>_a,network_socket_bind:()=>na,network_socket_close:()=>Ia,network_socket_connect:()=>sa,network_socket_init:()=>ia,network_socket_listen:()=>oa,network_socket_readline:()=>ua,network_socket_receive:()=>ra,network_socket_receive_from:()=>aa,network_socket_send:()=>pa,network_socket_send_to:()=>la,network_stop:()=>Zp,network_wifi_connect:()=>qp,ntptime_address:()=>ma,ntptime_time:()=>Ma,requests_attribute:()=>Ta,requests_attribute2:()=>Ra,requests_get:()=>da,requests_get2:()=>ca,requests_method:()=>ha,requests_post:()=>Ea});var D={};t.r(D),t.d(D,{HCSR04:()=>qa,RTC_set_date:()=>ja,RTC_set_time:()=>Qa,bitbot_als_num:()=>oI,dht11:()=>II,educore_button_sensor:()=>RI,educore_button_was_pressed:()=>gI,educore_gyroscope_sensor:()=>OI,educore_gyroscope_sensor_read:()=>cI,educore_gyroscope_sensor_shake:()=>EI,educore_light_sensor:()=>mI,educore_rfid_sensor:()=>CI,educore_rfid_sensor_scan:()=>AI,educore_rfid_sensor_scan_data:()=>LI,educore_voice_sensor:()=>hI,number1:()=>Za,number2:()=>$a,number3:()=>tl,number4:()=>el,number5:()=>il,number6:()=>nl,number7:()=>sl,onboard_RTC_get_time:()=>Il,onboard_RTC_get_time_str:()=>Ol,onboard_RTC_get_timestamp:()=>dl,onboard_RTC_get_timetuple_to_str:()=>cl,onboard_RTC_set_datetime:()=>Ml,onboard_RTC_settime_string:()=>hl,onboard_RTC_timestamp_totuple:()=>Tl,rfid_readcontent:()=>Sl,rfid_readid:()=>Ll,rfid_status:()=>Nl,rfid_write:()=>fl,rfid_write_return:()=>Dl,sensor_LTR308:()=>El,sensor_aht11:()=>gl,sensor_bitbot_ALS:()=>sI,sensor_button_get_presses:()=>rI,sensor_button_is_pressed:()=>_I,sensor_button_was_pressed:()=>uI,sensor_distance_hrsc04:()=>Ja,sensor_eulerangles:()=>Fl,sensor_field_strength:()=>dI,sensor_get_acceleration:()=>Pl,sensor_get_temperature:()=>Cl,sensor_get_the_coprocessor_version:()=>SI,sensor_hp203:()=>Al,sensor_light:()=>lI,sensor_mixbot_get_gyro:()=>nI,sensor_mixbot_patrol_calibrate:()=>tI,sensor_mixbot_patrol_value:()=>eI,sensor_mixbot_temperature:()=>iI,sensor_mixgo_LTR308:()=>al,sensor_mixgo_button_attachInterrupt:()=>Ba,sensor_mixgo_button_get_presses:()=>Va,sensor_mixgo_button_is_pressed:()=>Xa,sensor_mixgo_button_was_pressed:()=>ya,sensor_mixgo_cc_mmc5603_calibrate_compass:()=>kl,sensor_mixgo_cc_mmc5603_get_angle:()=>wl,sensor_mixgo_cc_mmc5603_get_magnetic:()=>Ul,sensor_mixgo_light:()=>za,sensor_mixgo_nova_LTR308:()=>pl,sensor_mixgo_nova_pin_near:()=>rl,sensor_mixgo_pin_near:()=>ul,sensor_mixgo_pin_near_double:()=>_l,sensor_mixgo_pin_near_single:()=>ol,sensor_mixgo_pin_pressed:()=>xa,sensor_mixgo_sant_color:()=>ll,sensor_mixgo_touch_slide:()=>Ka,sensor_mixgocar42_button_attachInterrupt:()=>ka,sensor_mixgocar42_button_get_presses:()=>wa,sensor_mixgocar42_button_is_pressed:()=>Ga,sensor_mixgocar42_button_was_pressed:()=>Ua,sensor_mixgocar_battery_left:()=>$l,sensor_mixgocar_pin_near:()=>zl,sensor_mixgocar_pin_near_line:()=>ql,sensor_mixgocar_pin_near_state_change:()=>Zl,sensor_mixgoce_pin_pressed:()=>Ha,sensor_mixgoce_temperature:()=>Hl,sensor_mixgome_temperature:()=>xl,sensor_mpython_pin_pressed:()=>Wa,sensor_mpython_qmi8658_get_gyro:()=>Wl,sensor_mpython_qmi8658_temperature:()=>Kl,sensor_onboard_compass_reset:()=>Gl,sensor_onboard_mpu9250_calibrate_compass:()=>yl,sensor_onboard_mpu9250_field_strength:()=>Bl,sensor_onboard_mpu9250_gesture:()=>vl,sensor_onboard_mpu9250_get_acceleration:()=>Yl,sensor_onboard_mpu9250_get_gyro:()=>Xl,sensor_onboard_mpu9250_get_magnetic:()=>bl,sensor_onboard_mpu9250_temperature:()=>Vl,sensor_pin_near:()=>aI,sensor_pin_pressed:()=>pI,sensor_read:()=>MI,sensor_rm_acc:()=>jl,sensor_rm_battery_left:()=>Ql,sensor_rm_pin_near_double:()=>Jl,sensor_rtc_init:()=>ml,sensor_sound:()=>Rl,sensor_temperature:()=>TI,simulated_light_sensor:()=>fI});var N={};t.r(N),t.d(N,{educore_mqtt_connect:()=>ud,educore_mqtt_connect_success:()=>ld,educore_mqtt_subscribe_message:()=>rd,educore_mqtt_topic_publish:()=>ad,educore_mqtt_topic_subscribe:()=>pd,educore_wifi_connect:()=>_d,network_ap_connect:()=>BI,network_connect:()=>FI,network_get_connect:()=>YI,network_get_wifi:()=>VI,network_init:()=>PI,network_is_active:()=>yI,network_open:()=>XI,network_scan:()=>GI,network_server:()=>UI,network_socket_accept:()=>WI,network_socket_bind:()=>kI,network_socket_close:()=>zI,network_socket_connect:()=>xI,network_socket_init:()=>wI,network_socket_listen:()=>HI,network_socket_readline:()=>KI,network_socket_receive:()=>JI,network_socket_receive_from:()=>jI,network_socket_send:()=>QI,network_socket_send_to:()=>qI,network_stop:()=>bI,network_wifi_connect:()=>vI,ntptime_address:()=>id,ntptime_time:()=>ed,requests_attribute:()=>$I,requests_attribute2:()=>sd,requests_get:()=>ZI,requests_get2:()=>nd,requests_method:()=>td,requests_post:()=>od});var P={};t.r(P),t.d(P,{HCSR04:()=>Ed,bitbot_als_num:()=>kT,dht11:()=>qT,educore_button_sensor:()=>nh,educore_button_was_pressed:()=>sh,educore_gyroscope_sensor:()=>th,educore_gyroscope_sensor_read:()=>eh,educore_gyroscope_sensor_shake:()=>ih,educore_light_sensor:()=>$T,educore_rfid_sensor:()=>oh,educore_rfid_sensor_scan:()=>_h,educore_rfid_sensor_scan_data:()=>uh,educore_voice_sensor:()=>zT,number1:()=>Rd,number2:()=>gd,number3:()=>Cd,number4:()=>Ad,number5:()=>Ld,number6:()=>Sd,number7:()=>fd,onboard_RTC_get_time:()=>OT,onboard_RTC_get_time_str:()=>RT,onboard_RTC_get_timestamp:()=>cT,onboard_RTC_get_timetuple_to_str:()=>gT,onboard_RTC_set_datetime:()=>MT,onboard_RTC_settime_string:()=>mT,onboard_RTC_timestamp_totuple:()=>ET,rfid_readcontent:()=>xd,rfid_readid:()=>kd,rfid_status:()=>Kd,rfid_write:()=>Hd,rfid_write_return:()=>Wd,sensor_LTR308:()=>Vd,sensor_adxl345_get_acceleration:()=>eT,sensor_aht11:()=>Ud,sensor_bitbot_ALS:()=>wT,sensor_button_get_presses:()=>WT,sensor_button_is_pressed:()=>xT,sensor_button_was_pressed:()=>HT,sensor_compass_reset:()=>uT,sensor_ds18x20:()=>Xd,sensor_eulerangles:()=>Qd,sensor_get_acceleration:()=>Jd,sensor_get_temperature:()=>wd,sensor_get_the_coprocessor_version:()=>rh,sensor_hp203:()=>Gd,sensor_light:()=>jT,sensor_lm35:()=>yd,sensor_mixbot_get_gyro:()=>UT,sensor_mixbot_patrol_calibrate:()=>VT,sensor_mixbot_patrol_value:()=>BT,sensor_mixbot_temperature:()=>GT,sensor_mixgo_LTR308:()=>vd,sensor_mixgo_button_attachInterrupt:()=>hd,sensor_mixgo_button_get_presses:()=>Td,sensor_mixgo_button_is_pressed:()=>Id,sensor_mixgo_button_was_pressed:()=>dd,sensor_mixgo_cc_mmc5603_calibrate_compass:()=>LT,sensor_mixgo_cc_mmc5603_get_angle:()=>AT,sensor_mixgo_cc_mmc5603_get_magnetic:()=>CT,sensor_mixgo_light:()=>QT,sensor_mixgo_nova_LTR308:()=>bd,sensor_mixgo_nova_pin_near:()=>Fd,sensor_mixgo_pin_near:()=>Pd,sensor_mixgo_pin_near_double:()=>Nd,sensor_mixgo_pin_near_single:()=>Dd,sensor_mixgo_pin_pressed:()=>$d,sensor_mixgo_sant_color:()=>Yd,sensor_mixgo_touch_slide:()=>Zd,sensor_mixgocar42_button_attachInterrupt:()=>cd,sensor_mixgocar42_button_get_presses:()=>Od,sensor_mixgocar42_button_is_pressed:()=>Md,sensor_mixgocar42_button_was_pressed:()=>md,sensor_mixgocar_battery_left:()=>yT,sensor_mixgocar_pin_near:()=>bT,sensor_mixgocar_pin_near_line:()=>YT,sensor_mixgocar_pin_near_state_change:()=>XT,sensor_mixgoce_pin_pressed:()=>zd,sensor_mixgoce_temperature:()=>fT,sensor_mixgome_temperature:()=>ST,sensor_mpu9250_calibrate_compass:()=>sT,sensor_mpu9250_field_strength:()=>_T,sensor_mpu9250_gesture:()=>jd,sensor_mpu9250_get_acceleration:()=>qd,sensor_mpu9250_get_gyro:()=>nT,sensor_mpu9250_get_magnetic:()=>iT,sensor_mpu9250_temperature:()=>oT,sensor_mpython_pin_pressed:()=>tT,sensor_mpython_qmi8658_get_gyro:()=>DT,sensor_mpython_qmi8658_temperature:()=>NT,sensor_onboard_compass_reset:()=>hT,sensor_onboard_mpu9250_calibrate_compass:()=>IT,sensor_onboard_mpu9250_field_strength:()=>TT,sensor_onboard_mpu9250_gesture:()=>rT,sensor_onboard_mpu9250_get_acceleration:()=>pT,sensor_onboard_mpu9250_get_gyro:()=>lT,sensor_onboard_mpu9250_get_magnetic:()=>aT,sensor_onboard_mpu9250_temperature:()=>dT,sensor_pin_near:()=>JT,sensor_pin_pressed:()=>KT,sensor_read:()=>ZT,sensor_rm_acc:()=>vT,sensor_rm_battery_left:()=>FT,sensor_rm_pin_near_double:()=>PT,sensor_sound:()=>Bd,simulated_light_sensor:()=>ph});var F={};t.r(F),t.d(F,{MP3_CONTROL:()=>wh,MP3_EQ_MODE:()=>Wh,MP3_INIT:()=>Gh,MP3_LOOP_MODE:()=>xh,MP3_PLAY_FOLDER:()=>Qh,MP3_PLAY_NUM:()=>Jh,MP3_VOL:()=>Kh,bit_motor_control:()=>bh,display_rgb:()=>yh,display_rgb2:()=>Vh,display_rgb_init:()=>Xh,display_rgb_show:()=>Bh,microbit_music_get_tempo:()=>Sh,microbit_music_pitch:()=>Rh,microbit_music_pitch_delay:()=>Eh,microbit_music_play_built_in:()=>Oh,microbit_music_play_built_in_easy:()=>ch,microbit_music_play_list_of_notes:()=>gh,microbit_music_play_list_of_notes_easy:()=>Ch,microbit_music_reset:()=>Ah,microbit_music_stop:()=>Lh,servo_move:()=>Yh,speech_pronounce_easy:()=>Fh,speech_say:()=>Dh,speech_say_easy:()=>Nh,speech_sing_easy:()=>Ph,speech_translate:()=>vh,tone_set_tempo:()=>fh});var v={};t.r(v),t.d(v,{i2c_init:()=>oM,i2c_read:()=>_M,i2c_write:()=>uM,microbit_radio_config:()=>$h,microbit_radio_off:()=>Zh,microbit_radio_on:()=>zh,microbit_radio_receive:()=>nM,microbit_radio_reset:()=>tM,microbit_radio_send_string:()=>eM,radio_ons:()=>qh,radio_receive_string:()=>sM,radio_send_string:()=>iM,spi_init:()=>rM,spi_write:()=>pM});var Y={};t.r(Y),t.d(Y,{display_fill:()=>VM,display_image_size:()=>yM,group_lcd_init:()=>vM,group_lcd_power:()=>bM,group_lcd_print:()=>FM,group_lcd_print2:()=>YM,image_arithmetic:()=>PM,image_shift:()=>NM,lp2i_u8g_draw_4strings:()=>XM,microbit_display_clear:()=>lM,microbit_display_is_on:()=>AM,microbit_display_off:()=>CM,microbit_display_on:()=>gM,microbit_display_scroll:()=>RM,microbit_display_scroll_string_animation:()=>EM,microbit_display_show_animation:()=>cM,microbit_display_show_default_image:()=>OM,microbit_display_show_image:()=>mM,microbit_image_builtins:()=>LM,microbit_image_copy:()=>SM,microbit_image_create:()=>DM,microbit_image_invert:()=>fM,monitor_bright_point:()=>dM,monitor_get_pixel:()=>IM,monitor_scroll_string:()=>hM,monitor_scroll_string_with_delay:()=>MM,monitor_show_image_or_string:()=>TM});var b={};t.r(b),t.d(b,{factory_block:()=>QM,factory_block_return:()=>jM,factory_block_return_with_textarea:()=>zM,factory_block_with_textarea:()=>qM,factory_callMethod_noreturn:()=>KM,factory_callMethod_return:()=>JM,factory_create_with_container:()=>kM,factory_create_with_item:()=>xM,factory_declare:()=>WM,factory_from_import:()=>GM,factory_function_noreturn:()=>wM,factory_function_return:()=>HM,factory_import:()=>UM});var X={};t.r(X),t.d(X,{inout_analog_read:()=>nm,inout_analog_write:()=>em,inout_analog_write_set:()=>im,inout_digital_read:()=>tm,inout_digital_write:()=>om,inout_highlow:()=>$M,sensor_pin_pressed:()=>sm});var y={};t.r(y),t.d(y,{pins_analog:()=>rm,pins_axis:()=>hm,pins_brightness:()=>Mm,pins_builtinimg:()=>dm,pins_button:()=>pm,pins_digital:()=>um,pins_imglist:()=>Tm,pins_interrupt:()=>lm,pins_pwm:()=>am,pins_radio_datarate:()=>cm,pins_radio_power:()=>Om,pins_serial:()=>Im,pins_tone_notes:()=>mm});var V={};t.r(V),t.d(V,{DS1307_init:()=>xm,NTC_TEMP:()=>$m,RTC_get_time:()=>Wm,RTC_set_date:()=>Jm,RTC_set_time:()=>Km,TCS34725_Get_RGB:()=>Zm,controls_GestureLists:()=>fm,controls_attachGestureInterrupt:()=>Sm,controls_attachGestureInterrupt2:()=>Dm,sensor_button_get_presses:()=>Cm,sensor_button_is_pressed:()=>Rm,sensor_button_was_pressed:()=>gm,sensor_calibrate_compass:()=>bm,sensor_compass_heading:()=>ym,sensor_compass_reset:()=>Qm,sensor_current_gesture:()=>vm,sensor_current_gesture1:()=>Am,sensor_current_gesture2:()=>Lm,sensor_distance_hrsc04:()=>wm,sensor_distance_hrsc04_:()=>km,sensor_field_strength:()=>Bm,sensor_get_acceleration:()=>Nm,sensor_get_gestures:()=>Fm,sensor_hrsc04_init:()=>qm,sensor_is_compass_calibrated:()=>Xm,sensor_light:()=>jm,sensor_light_level:()=>Ym,sensor_magnetic:()=>Um,sensor_rotation:()=>Gm,sensor_set_acceleration:()=>Pm,sensor_temperature:()=>Vm});var B={};t.r(B),t.d(B,{IO_input:()=>lO,IO_print:()=>IO,IO_print_inline:()=>dO,serial_any:()=>_O,serial_begin:()=>aO,serial_print:()=>eO,serial_print_hex:()=>nO,serial_println:()=>iO,serial_readline:()=>uO,serial_readstr:()=>oO,serial_readstr_until:()=>rO,serial_receive_data_event:()=>sO,serial_softserial:()=>pO});var G={};t.r(G),t.d(G,{Panic_with_status_code:()=>mO,base_delay:()=>hO,controls_millis:()=>MO,controls_uname:()=>cO,reset:()=>OO});var U={};t.r(U),t.d(U,{MP3_CONTROL:()=>wO,MP3_EQ_MODE:()=>xO,MP3_INIT:()=>UO,MP3_LOOP_MODE:()=>kO,MP3_PLAY_FOLDER:()=>KO,MP3_PLAY_NUM:()=>WO,MP3_VOL:()=>HO,bit_motor_control:()=>XO,display_rgb:()=>VO,display_rgb2:()=>BO,display_rgb_init:()=>yO,display_rgb_show:()=>GO,microbit_music_get_tempo:()=>fO,microbit_music_pitch:()=>CO,microbit_music_pitch_delay:()=>gO,microbit_music_play_built_in:()=>EO,microbit_music_play_built_in_easy:()=>RO,microbit_music_play_list_of_notes:()=>AO,microbit_music_reset:()=>LO,microbit_music_stop:()=>SO,servo_move:()=>bO,speech_pronounce_easy:()=>YO,speech_say:()=>PO,speech_say_easy:()=>FO,speech_sing_easy:()=>vO,speech_translate:()=>NO,tone_set_tempo:()=>DO});var w={};t.r(w),t.d(w,{i2c_init:()=>ec,i2c_read:()=>ic,i2c_write:()=>nc,microbit_radio_config:()=>qO,microbit_radio_off:()=>jO,microbit_radio_on:()=>QO,microbit_radio_receive:()=>tc,microbit_radio_reset:()=>zO,radio_ons:()=>JO,radio_receive_string:()=>$O,radio_send_string:()=>ZO,spi_init:()=>sc,spi_write:()=>oc});var k={};t.r(k),t.d(k,{display_fill:()=>vc,display_image_size:()=>Fc,group_lcd_init:()=>fc,group_lcd_power:()=>Nc,group_lcd_print:()=>Sc,group_lcd_print2:()=>Dc,image_arithmetic:()=>Ac,image_shift:()=>Cc,lp2i_u8g_draw_4strings:()=>Pc,microbit_display_clear:()=>_c,microbit_display_is_on:()=>Oc,microbit_display_on:()=>mc,microbit_display_scroll:()=>Mc,microbit_display_scroll_string_animation:()=>Lc,microbit_display_set_pixel:()=>rc,microbit_display_show_animation:()=>hc,microbit_display_show_default_image:()=>Tc,microbit_display_show_image:()=>dc,microbit_image_builtins:()=>cc,microbit_image_copy:()=>Ec,microbit_image_create:()=>gc,microbit_image_invert:()=>Rc,monitor_bright_point:()=>pc,monitor_get_pixel:()=>uc,monitor_scroll_string:()=>lc,monitor_scroll_string_with_delay:()=>Ic,monitor_show_image_or_string:()=>ac});var x={};t.r(x),t.d(x,{factory_block:()=>Uc,factory_block_return:()=>wc,factory_block_return_with_textarea:()=>xc,factory_block_with_textarea:()=>kc,factory_callMethod_noreturn:()=>Bc,factory_callMethod_return:()=>Gc,factory_declare:()=>Vc,factory_from_import:()=>Yc,factory_function_noreturn:()=>Xc,factory_function_return:()=>yc,factory_import:()=>bc});var H={};t.r(H),t.d(H,{inout_analog_read:()=>jc,inout_analog_write:()=>Jc,inout_analog_write_set:()=>Qc,inout_digital_read:()=>Kc,inout_digital_write:()=>Wc,inout_highlow:()=>Hc,sensor_pin_pressed:()=>qc});var W={};t.r(W),t.d(W,{pins_analog:()=>Zc,pins_axis:()=>oE,pins_brightness:()=>_E,pins_builtinimg:()=>nE,pins_button:()=>$c,pins_digital:()=>zc,pins_imglist:()=>sE,pins_interrupt:()=>eE,pins_pwm:()=>tE,pins_radio_datarate:()=>pE,pins_radio_power:()=>rE,pins_serial:()=>iE,pins_tone_notes:()=>uE});var K={};t.r(K),t.d(K,{DS1307_init:()=>vE,NTC_TEMP:()=>UE,RTC_get_time:()=>YE,RTC_set_date:()=>XE,RTC_set_time:()=>bE,TCS34725_Get_RGB:()=>GE,controls_GestureLists:()=>dE,controls_attachGestureInterrupt:()=>TE,controls_attachGestureInterrupt2:()=>mE,sensor_button_get_presses:()=>IE,sensor_button_is_pressed:()=>aE,sensor_button_was_pressed:()=>lE,sensor_calibrate_compass:()=>CE,sensor_compass_heading:()=>LE,sensor_compass_reset:()=>yE,sensor_current_gesture:()=>cE,sensor_current_gesture1:()=>hE,sensor_current_gesture2:()=>ME,sensor_distance_hrsc04:()=>PE,sensor_distance_hrsc04_:()=>FE,sensor_field_strength:()=>fE,sensor_get_acceleration:()=>EE,sensor_get_gestures:()=>OE,sensor_hrsc04_init:()=>BE,sensor_is_compass_calibrated:()=>AE,sensor_light:()=>VE,sensor_light_level:()=>gE,sensor_magnetic:()=>NE,sensor_rotation:()=>DE,sensor_set_acceleration:()=>RE,sensor_temperature:()=>SE});var J={};t.r(J),t.d(J,{IO_input:()=>zE,IO_print:()=>ZE,IO_print_inline:()=>$E,serial_any:()=>WE,serial_begin:()=>qE,serial_print:()=>wE,serial_print_hex:()=>xE,serial_println:()=>kE,serial_readline:()=>JE,serial_readstr:()=>KE,serial_readstr_until:()=>QE,serial_receive_data_event:()=>HE,serial_softserial:()=>jE});var Q={};t.r(Q),t.d(Q,{Panic_with_status_code:()=>IR,base_delay:()=>lR,controls_end_program:()=>TR,controls_millis:()=>dR,controls_uname:()=>MR,reset:()=>hR,system_device_name:()=>pR,system_device_serial_number:()=>aR,system_event_bus_source:()=>uR,system_event_bus_value:()=>rR,system_on_event:()=>sR,system_raise_event:()=>nR,system_reset:()=>eR,system_run_in_background:()=>tR,system_timestamp:()=>oR,system_value:()=>_R,system_wait:()=>iR});const j=Blockly,q=Mixly,z={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var i=Object.create(null),n=0;n<e.length;n++)for(var s=e[n].getVars(),o=0;o<s.length;o++){var _=s[o];_&&(i[_]=_)}var u=[];for(var r in i)u.push(i[r]);return u},renameVariable:function(t,e,i){j.Events.setGroup(!0);for(var n=i.getAllBlocks(),s=0;s<n.length;s++)n[s].renameVar(t,e);j.Events.setGroup(!1)},flyoutCategory:function(t){var e=z.allVariables(t),i=[];((_=j.utils.xml.createElement("block")).setAttribute("type","variables_global"),i.push(_),j.Blocks.variables_set)&&((_=j.utils.xml.createElement("block")).setAttribute("type","variables_set"),i.push(_));j.Blocks.variables_change&&((_=j.utils.xml.createElement("block")).setAttribute("type","variables_change"),i.push(_));j.Blocks.controls_type&&((_=j.utils.xml.createElement("block")).setAttribute("type","controls_type"),i.push(_));j.Blocks.controls_typeLists&&((_=j.utils.xml.createElement("block")).setAttribute("type","controls_typeLists"),i.push(_));if(j.Blocks.lists_zip){(_=j.utils.xml.createElement("block")).setAttribute("type","lists_zip"),_.setAttribute("inline","false");var n=j.utils.xml.createElement("mutation");n.setAttribute("items",2),_.appendChild(n);for(let t=0;t<2;t++){let e=j.utils.xml.createElement("value");e.setAttribute("name",`ADD${t}`),_.appendChild(e)}i.push(_)}j.Blocks.unpack_iterable_object&&((_=j.utils.xml.createElement("block")).setAttribute("type","unpack_iterable_object"),i.push(_));for(var s=0;s<e.length;s++){if(j.Blocks.variables_set){(_=j.utils.xml.createElement("block")).setAttribute("type","variables_set"),j.Blocks.variables_get&&_.setAttribute("gap",8),(u=j.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");var o=j.utils.xml.createTextNode(e[s]);u.appendChild(o),_.appendChild(u),i.push(_)}if(j.Blocks.variables_get){var _,u;(_=j.utils.xml.createElement("block")).setAttribute("type","variables_get"),j.Blocks.variables_set&&_.setAttribute("gap",24),(u=j.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");o=j.utils.xml.createTextNode(e[s]);u.appendChild(o),_.appendChild(u),i.push(_)}}return i},generateUniqueName:function(t){var e=z.allVariables(t),i="";if(e.length)for(var n=1,s="ijkmnopqrstuvwxyzabcdefgh",o=0,_=s.charAt(o);!i;){for(var u=!1,r=0;r<e.length;r++)if(e[r]==_){u=!0;break}u?(25==++o&&(o=0,n++),_=s.charAt(o),n>1&&(_+=n)):i=_}else i="i";return i}},Z=z;
/**
* @license
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ${constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n<i.length;n++)this.reservedDict_[i[n]]=!0;this.reset()}static equals(t,e){return t==e}reset(){this.db_=Object.create(null),this.dbReverse_=Object.create(null),this.variableMap_=null}setVariableMap(t){this.variableMap_=t}getNameForUserVariable_(t){if(!this.variableMap_)return null;var e=this.variableMap_.getVariableById(t);return e?e.name:null}getName(t,e){if(e==Z.NAME_TYPE){var i=this.getNameForUserVariable_(t);i&&(t=i)}var n=t+"_"+e,s=e==Z.NAME_TYPE||e==$.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"";if(n in this.db_)return s+this.db_[n];var o=this.getDistinctName(t,e);return this.db_[n]=o.substr(s.length),o}getDistinctName(t,e){for(var i=this.safeName_(t),n="";this.dbReverse_[i+n]||i+n in this.reservedDict_;)n=n?n+1:2;return i+=n,this.dbReverse_[i]=!0,(e==Z.NAME_TYPE||e==$.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"")+i}safeName_(t){return t?(t=encodeURI(t.replace(/ /g,"_")).replace(/[^,\w]/g,"_"),-1!="0123456789".indexOf(t[0])&&(t="my_"+t)):t="unnamed",t}}$.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE";const tt=$,et=330,it={init:function(){this.setColour(et),this.appendDummyInput().appendField(new j.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(j.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){tt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},nt={init:function(){this.setColour(et),this.appendValueInput("VALUE").appendField(new j.FieldTextInput(""),"VAR").appendField(j.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){tt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},st={init:function(){this.setColour(et);var t=[[j.Msg.LANG_MATH_INT,"int"],[j.Msg.LANG_MATH_FLOAT,"float"],[j.Msg.LANG_MATH_BOOLEAN,"bool"],[j.Msg.LANG_MATH_STRING,"str"],[j.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[j.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[j.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[j.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new j.FieldDropdown(t),"OP"),this.setOutput(!0)}},ot={init:function(){this.setColour(et),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.TEXT_PRINT_TOOLTIP)}},_t={init:function(){this.setColour(et),this.appendValueInput("DATA").appendField(j.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(j.Msg.MICROBIT_PYTHON_TYPE)}},ut={init:function(){this.setColour(et),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new j.FieldDropdown([[j.Msg.LANG_MATH_INT,"int"],[j.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[j.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[j.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[j.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[j.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[j.Msg.LANG_MATH_BYTE,"bytes"],[j.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return j.Msg.MICROBIT_controls_TypeLists+{int:j.Msg.LANG_MATH_INT,float:j.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:j.Msg.MIXLY_MICROBIT_TYPE_STRING,list:j.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:j.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:j.Msg.MIXLY_MICROBIT_TYPE_DICT,set:j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:j.Msg.MIXLY_MICROBIT_IMAGE,bytes:j.Msg.LANG_MATH_BYTE,NoneType:j.Msg.LOGIC_NULL}[e]}))}},rt={init:function(){this.setColour(et),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new j.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(j.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;n<this.itemCount_;n++){var s=t.newBlock("lists_zip_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.MIXLY_PYTHON_LISTS_ZIP);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.MIXLY_PYTHON_LISTS_ZIP)}}},pt={init:function(){this.setColour(et),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_LISTS_ZIP),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},at={init:function(){this.setColour(et),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM_TOOLTIP),this.contextMenu=!1}},lt={init:function(){this.setColour(et),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_VARIABLE_UNPACK).appendField(new j.FieldDropdown([[j.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM,"*"],[j.Msg.MIXLY_MICROBIT_TYPE_DICT,"**"]]),"TYPE"),this.setTooltip(""),this.setOutput(!0)}},It=120,dt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(j.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},Tt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(j.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},ht={init:function(){var t=[[j.Msg.MIXLY_mSecond,"delay"],[j.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(It),this.appendValueInput("DELAY_TIME",Number).appendField(j.Msg.MIXLY_DELAY).appendField(new j.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},Mt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(j.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},mt={init:function(){this.setColour(It),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(j.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(j.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new j.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?j.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?j.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?j.Msg.CONTROLS_IF_TOOLTIP_4:"":j.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,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.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")}},Ot={init:function(){this.setColour(It),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)}},ct={init:function(){this.setColour(It),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")}},Et={init:function(){this.setColour(It),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]}))}},Rt={init:function(){this.setColour(It),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")}},gt={init:function(){this.setColour(It);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)}}},Ct={init:function(){this.setColour(It),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")}},At={init:function(){this.setColour(It),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")}};Et.OPERATORS=[[j.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[j.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],gt.OPERATORS=[[j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Lt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},St={init:function(){this.setColour(It),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}},ft={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(j.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Dt={init:function(){this.setColour(It),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Nt={init:function(){this.setColour(It),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)}},Pt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(j.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Ft={init:function(){this.jsonInit({message0:j.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:It,tooltip:j.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:j.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},vt={init:function(){this.setColour(It),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(j.Msg.MIXLY_STAT),this.setOutput(!0)}},Yt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},bt={init:function(){this.setColour(It),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)}},Xt={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(It),this.setTooltip("do-while loop"),this.setHelpUrl("")}},yt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Bt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},Gt={init:function(){this.setColour(It),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(It),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)}},wt={init:function(){this.setColour(It),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},kt=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 xt={init:function(){this.setColour(kt),this.appendDummyInput().appendField(new j.FieldTextInput("0",j.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(j.Msg.MATH_NUMBER_TOOLTIP)}},Ht={init:function(){this.setColour(kt);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]}))}},Wt={init:function(){this.setColour(kt);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]}))}},Kt={init:function(){this.setColour(kt),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]}))}},Jt={init:function(){this.setColour(kt),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]}))}},Qt={init:function(){this.setColour(kt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new j.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},jt={init:function(){this.setColour(kt),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]}))}},qt={init:function(){var t=[[j.Msg.MATH_BIN,"bin"],[j.Msg.MATH_OCT,"oct"],[j.Msg.MATH_HEX,"hex"]];this.setColour(kt),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]}))}},zt={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(kt),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]}))}},Zt={init:function(){var t=[[j.Msg.MIXLY_MAX,"max"],[j.Msg.MIXLY_MIN,"min"]];this.setColour(kt),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]}))}},$t={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(kt),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]}))}},te={init:function(){var t=[[j.Msg.LANG_MATH_INT,"int"],[j.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(kt),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]}))}},ee={init:function(){this.setColour(kt),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)}},ie={init:function(){this.setColour(kt),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)}},ne={init:function(){this.setColour(kt),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)}},se={init:function(){this.setColour(kt),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)}},oe={init:function(){this.setColour(kt),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)}},_e={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(kt),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]}))}},ue={init:function(){var t=[[j.Msg.MIXLY_TO_INT,"int"],[j.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(kt),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]}))}},re=ie,pe={init:function(){this.setColour(kt),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)}},ae={init:function(){this.setColour(kt),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;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput(`ADD${n}`).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput(`ADD${i}`);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else{let t=0;for(;this.getInput(`ADD${t}`);)this.removeInput(`ADD${t}`),t++}if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.MIXLY_EMPTY_REMINDER);else for(let t=0;t<this.itemCount_;t++)this.appendValueInput(`ADD${t}`),this.moveInputBefore(`ADD${t}`,"REPEAT")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},le={init:function(){this.setColour(kt),this.setOutput(!0),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_SET_RADIAN),this.appendDummyInput().appendField(j.Msg.MIXLY_TRANS_TO_ANGLE),this.setInputsInline(!0)}},Ie={init:function(){this.setColour(kt),this.setOutput(!0),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_SET_DEGREE),this.appendDummyInput().appendField(j.Msg.MIXLY_TRANS_TO_RADIAN),this.setInputsInline(!0)}},de=160,Te={init:function(){this.setColour(de),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new j.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(j.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new j.FieldImage(e,12,12,'"')}},he={init:function(){this.setColour(de),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new j.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(j.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new j.FieldImage(e,12,12,'"')}},Me={init:function(){this.setColour(de),this.appendDummyInput().appendField(j.Msg.MIXLY_TEXT_BYTES).appendField(this.newQuote_(!0)).appendField(new j.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(j.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new j.FieldImage(e,12,12,'"')}};j.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===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 me={init:function(){this.setColour(de),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,'"')}},Oe={init:function(){this.setColour(de),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)}},ce={init:function(){this.setColour(de),this.appendValueInput("VAR").setCheck(Number).appendField(j.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(j.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ee={init:function(){this.setColour(de),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Re={init:function(){this.setColour(de),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ge={init:function(){this.setColour(de),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Ce={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(de),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)}},Ae={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(de),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)}},Le={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(de),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(j.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(j.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Se={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(de),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"))}},fe={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(de),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)}},De={init:function(){var t=[[j.Msg.MIXLY_EQUALS,"==="],[j.Msg.MIXLY_STARTSWITH,"startswith"],[j.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(de),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new j.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ne={init:function(){this.setColour(de),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)}},Pe={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(de),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]}))}},Fe={init:function(){var t=[[j.Msg.TEXT_LJUST,"ljust"],[j.Msg.TEXT_CENTER,"center"],[j.Msg.TEXT_RJUST,"rjust"]];this.setColour(de),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)}},ve={init:function(){this.setColour(de),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)}},Ye={init:function(){this.setColour(de),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)}},be={init:function(){this.setColour(de),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)}},Xe={init:function(){this.setColour(de),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)}},ye={init:function(){var t=[[j.Msg.TEXT_TRIM_BOTH,"strip"],[j.Msg.TEXT_TRIM_LEFT,"lstrip"],[j.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(de),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]}))}},Ve={init:function(){this.setColour(de),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;n<this.itemCount_;n++){var s=t.newBlock("text_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.PROCEDURES_BEFORE_PARAMS)}},getVars:function(){if(null!=this.getFieldValue("VAR"))return-1==this.getFieldValue("VAR").indexOf("'")&&-1==this.getFieldValue("VAR").indexOf('"')?[this.getFieldValue("VAR")]:[]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Be={init:function(){this.setColour(de),this.appendDummyInput().appendField(j.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ge={init:function(){this.setColour(de),this.appendDummyInput().appendField(j.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ue=fe,we=Ne,ke=Ae,xe={init:function(){this.setColour(de),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendValueInput("VAR").setCheck(String),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;n<this.itemCount_;n++){var s=t.newBlock("text_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.PROCEDURES_BEFORE_PARAMS)}}},He={init:function(){this.setColour(de);var t=[[j.Msg.MIXPY_TEXT_ENCODE,"encode"],[j.Msg.MIXPY_TEXT_DECODE,"decode"]];this.appendDummyInput().appendField(new j.FieldDropdown([["ASCII","ASCII"],["gb2312","gb2312"],["gbk","gbk"],["utf-8","utf-8"],["utf-16","utf-16"],["utf-32","utf-32"]]),"CODE").appendField(" "),this.appendValueInput("VAR").appendField(new j.FieldDropdown(t),"DIR").appendField(j.Msg.LANG_MATH_STRING),this.setOutput(!0,String),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXPY_TEXT_ENCODE_DECODE_TOOLTIP)}},We={init:function(){this.setColour(de),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_PYTHON_TEXT_EVAL),this.appendDummyInput().appendField(j.Msg.MIXLY_PYTHON_TEXT_EVAL_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_TEXT_EVAL_TOOLTIP)}},Ke={init:function(){this.setColour(de),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_PYTHON_OS_SYSTEM),this.setInputsInline(!0),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_OS_SYSTEM_TOOLTIP)}},Je=260,Qe={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Je),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(j.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(j.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM)}},je={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Je),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(j.Msg.TEXT_CHARAT_TAIL+" "+j.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(j.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setTooltip(j.Msg.PYTHON_LISTS_GET_SUBLIST_TOOLTIP)}},qe={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row").setCheck(null).appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.DATAFRAME_RAW),this.appendValueInput("col").setCheck(null).appendField(j.Msg.DATAFRAME_COLUMN),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(Je),this.setTooltip(""),this.setHelpUrl("")}},ze={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row_start").setCheck(null).appendField(j.Msg.MIXLY_GET+" "+j.Msg.DATAFRAME_RAW+" ["),this.appendValueInput("row_end").setCheck(null).appendField(","),this.appendValueInput("col_start").setCheck(null).appendField(") "+j.Msg.DATAFRAME_COLUMN+" ["),this.appendValueInput("col_end").setCheck(null).appendField(","),this.appendDummyInput().appendField(") "+j.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setColour(Je),this.setTooltip(""),this.setHelpUrl("")}},Ze={init:function(){this.setColour(Je),this.appendDummyInput("").appendField(new j.FieldTextInput("mylist"),"VAR").appendField("[").appendField("]"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new j.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(j.Msg.LISTS_CREATE_WITH_PYTHON_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_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$e={init:function(){this.setColour(Je),this.appendDummyInput("").appendField(new j.FieldTextInput("mylist"),"VAR").appendField(" = [").appendField(new j.FieldTextInput("0,0,0"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_LISTS_CREATE_WITH_TEXT2)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ti={init:function(){this.setColour(Je),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_TYPE_LIST),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ei={init:function(){this.setColour(Je),this.appendDummyInput().appendField(j.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ii={init:function(){this.setColour(Je),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(j.Msg.MIXLY_MICROBIT_LIST_ASSIGN_AT),this.appendValueInput("TO").appendField(j.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.LANG_LISTS_SET_INDEX_TOOLTIP)}},ni={init:function(){this.setColour(Je),this.TYPE=[[j.Msg.MIXLY_blockpy_set_add,"append"],[j.Msg.MIXLY_MICROBIT_LIST_EXTEND,"extend"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(new j.FieldDropdown(this.TYPE),"OP").appendField(j.Msg.MIXLY_MICROBIT_LIST_A_ITEM),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_LIST_TO_END),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{append:j.Msg.MIXLY_TOOLTIP_LIST_APPEND,extend:j.Msg.LISTS_EXTEND_TOOLTIP}[e]}))}},si={init:function(){this.setColour(Je),this.appendValueInput("LIST"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(j.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},oi={init:function(){this.setColour(Je),this.appendValueInput("LIST"),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_MICROBIT_RANDOM),this.appendDummyInput().appendField(j.Msg.LANG_LISTS_GET_INDEX2+j.Msg.LISTS_GET_RANDOM_SUBLIST),this.setTooltip(j.Msg.LISTS_GET_RANDOM_SUBLIST_TOOLTIP),this.setOutput(!0,"List")}},_i={init:function(){this.setColour(Je),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(j.Msg.MIXLY_MICROBIT_JS_LIST_INSERT_AT),this.appendValueInput("VALUE").appendField(j.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.LANG_LISTS_SET_INDEX_TOOLTIP),this.setTooltip(j.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT)}},ui={init:function(){this.setColour(Je),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_LIST_REVERSE),this.setTooltip(j.Msg.LANG_LISTS_CLEAR_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ri={init:function(){this.setColour(Je),this.appendValueInput("VAR"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROPYTHON_CLEAR),this.setTooltip(j.Msg.LANG_LISTS_REVERSE_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pi={init:function(){this.setColour(Je),this.TYPE=[[j.Msg.SERIES_INDEX,"del"],[j.Msg.MIXLY_MICROBIT_JS_I2C_VALUE,"remove"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(j.Msg.MIXLY_MIXPY_LISTS_REMOVE).appendField(new j.FieldDropdown(this.TYPE),"OP"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{del:j.Msg.LISTS_SET_INDEX_TOOLTIP_DELETE,remove:j.Msg.MIXLY_TOOLTIP_LIST_REMOVE}[e]}))}},ai={init:function(){this.setColour(Je),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(j.Msg.MIXLY_MICROBIT_LIST_POP),this.appendDummyInput().appendField(j.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(j.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM)}},li={init:function(){var t=[[j.Msg.MIXLY_LIST_INDEX,"INDEX"],[j.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Je),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(j.Msg.HTML_VALUE),this.appendDummyInput().appendField(j.Msg.MIXLY_DE).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:j.Msg.MIXLY_TOOLTIP_LIST_FIND_INDEX,COUNT:j.Msg.MIXLY_TOOLTIP_LIST_FIND_COUNT}[t]}))}},Ii={init:function(){var t=[[j.Msg.MIXLY_LIST_LEN,"LEN"],[j.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[j.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[j.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[j.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[j.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[j.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[j.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Je),this.setOutput(!0,Number),this.appendValueInput("data"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:j.Msg.LISTS_LENGTH_TOOLTIP,SUM:j.Msg.MATH_ONLIST_TOOLTIP_SUM,MAX:j.Msg.MATH_ONLIST_TOOLTIP_MAX,MIN:j.Msg.MATH_ONLIST_TOOLTIP_MIN,AVERAGE:j.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:j.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:j.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:j.Msg.MATH_ONLIST_TOOLTIP_STD_DEV}[t]}))}},di={init:function(){this.jsonInit({args0:[{type:"input_value",name:"LIST",check:"List"},{type:"field_dropdown",name:"TYPE",options:[[j.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[j.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[j.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[j.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[j.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]}],message0:j.Msg.LISTS_SORT_TITLE,inputsInline:!0,output:"List",colour:Je,tooltip:j.Msg.LISTS_SORT_TOOLTIP,helpUrl:j.Msg.LISTS_SORT_HELPURL})}},Ti={init:function(){var t=[[j.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[j.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD,"array"]];this.setColour(Je),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput("").appendField(j.Msg.A_TO_B).appendField(new j.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{tuple:j.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_TUPLE,set:j.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_SET,array:j.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_ARRAY}[t]})),this.setInputsInline(!0),this.setOutput(!0)}},hi={init:function(){this.setColour(Je),this.appendDummyInput("").appendField("[").appendField(new j.FieldTextInput("0,0,0"),"CONTENT").appendField("]"),this.setInputsInline(!0),this.setOutput(!0)}},Mi={init:function(){this.setColour(Je),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new j.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(j.Msg.LISTS_CREATE_WITH_PYTHON_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_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mi={init:function(){var t=[[j.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[j.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Je),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(j.Msg.A_TO_B).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0)}},Oi={init:function(){this.setColour(Je),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(j.Msg.OBJECT_DELETE),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ci={init:function(){this.setColour(Je),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TOLIST),this.setOutput(!0,"List"),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TOLIST)}},Ei=Ze,Ri=$e,gi=Qe,Ci=je,Ai=ii,Li=_i,Si=pi,fi=ci,Di={init:function(){this.setColour(Je),this.appendValueInput("VAR").appendField(j.Msg.blockpy_USE_LIST),this.appendDummyInput().appendField(j.Msg.MIXLY_TO_INDEX_SEQUENCE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Ni={init:function(){this.setColour(Je),this.appendDummyInput().appendField(j.Msg.blockpy_USE_LIST),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(j.Msg.MIXLY_TO_INDEX_SEQUENCE).appendField(j.Msg.MIXLY_INDEX+j.Msg.MIXLY_STARTSWITH),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Pi={init:function(){this.setColour(Je),this.appendValueInput("CON"),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_MIXGO_MUSIC_SHOW_IN),this.appendValueInput("LIST"),this.appendDummyInput().appendField(j.Msg.MIXLY_MID),this.setInputsInline(!0),this.setOutput(!0)}},Fi=345,vi={init:function(){this.setColour(Fi),this.appendDummyInput("").appendField(new j.FieldTextInput("mydict"),"VAR").appendField(new j.FieldLabel(j.Msg.DICTS_CREATE_WITH_INPUT_WITH),"TIP"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),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;n<this.itemCount_;n++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(j.Msg.DICTS_CREATE_EMPTY_TITLE);else{this.getField("TIP").setValue(j.Msg.DICTS_CREATE_WITH_INPUT_WITH);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(j.inputs.Align.RIGHT).appendField(new j.FieldTextInput(t.length>e?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")}},Yi={init:function(){this.setColour(Fi),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},bi={init:function(){this.setColour(Fi),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}},Xi={init:function(){this.setColour(Fi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(j.Msg.DICT_KEYS),this.setTooltip(j.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},yi={init:function(){this.setColour(Fi),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)}},Vi={init:function(){this.setColour(Fi),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)}},Bi={init:function(){this.setColour(Fi),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)}},Gi={init:function(){this.setColour(Fi),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)}},Ui={init:function(){this.setColour(Fi),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)}},wi={init:function(){this.setColour(Fi),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)}},ki={init:function(){this.setColour(Fi),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(Fi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(j.Msg.DICT_VALUES),this.setTooltip(j.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Hi={init:function(){this.setColour(Fi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(j.Msg.MIXLY_LENGTH),this.setTooltip(j.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Wi={init:function(){this.setColour(Fi),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)}},Ki={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(Fi),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")}},Ji={init:function(){this.setColour(Fi),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)}},Qi={init:function(){this.setColour(Fi),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)}},ji={init:function(){this.setColour(Fi),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;n<this.itemCount_;n++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(j.Msg.LOGIC_NULL+j.Msg.MIXLY_MICROBIT_TYPE_DICT);else{this.getField("TIP").setValue(j.Msg.MIXLY_MICROBIT_TYPE_DICT);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(j.inputs.Align.RIGHT).appendField(new j.FieldTextInput(t.length>e?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")}},qi={init:function(){this.setColour(Fi),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},zi={init:function(){this.setColour(Fi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(j.Msg.MIXLY_TO_JSON),this.setTooltip(j.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Zi={init:function(){this.setColour(Fi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(j.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(j.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},$i={init:function(){this.setColour(Fi),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)}},tn={init:function(){this.setColour(Fi),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(j.Msg.MIXLY_TO_JSON),this.setTooltip(j.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},en=210,nn={init:function(){var t=j.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 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]}},sn={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(en),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)}},on={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(en),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]}))}},_n={init:function(){this.setColour(en),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(j.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(j.Msg.LOGIC_NEGATE_TOOLTIP)}},un={init:function(){var t=[[j.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[j.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(en),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new j.FieldDropdown(t),"BOOL"),this.setTooltip(j.Msg.LOGIC_BOOLEAN_TOOLTIP)}},rn={init:function(){this.setColour(en),this.setOutput(!0),this.appendDummyInput().appendField(j.Msg.LOGIC_NULL),this.setTooltip(j.Msg.LOGIC_NULL_TOOLTIP)}},pn={init:function(){this.setColour(en),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)}},an={init:function(){var t=[[j.Msg.TEXT_APPEND_TO,"in"],[j.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(en),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)}},ln={init:function(){var t=[[j.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[j.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(en),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)}},In={init:function(){this.setColour(en),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},dn={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)}},Tn={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"],[j.Msg.MIXLY_ADD,"a"],[j.Msg.MATH_BIN+j.Msg.MIXLY_ADD,"ab"],[j.Msg.MIXLY_R_W,"r+"],[j.Msg.MATH_BIN+j.Msg.MIXLY_R_W,"rb+"],[j.Msg.MIXLY_W_R,"w+"],[j.Msg.MATH_BIN+j.Msg.MIXLY_W_R,"wb+"],[j.Msg.MIXLY_A_R,"a+"],[j.Msg.MATH_BIN+j.Msg.MIXLY_A_R,"ab+"]]),"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")}},hn={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+_}))}},Mn={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+_}))}},mn={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)}},On={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)}},cn={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}))}},En={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)}},Rn={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)}},gn={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)}},Cn={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)}},An={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 Ln={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)}},Sn={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)}},fn={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)}},Dn={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}))}},Nn={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)}},Pn={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]}))}},Fn={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)}},vn={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)}},Yn={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]}))}},bn={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)}},Xn={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()}},yn={init:function(){var t=j.Procedures.findLegalName("",this),e=new j.FieldTextInput(t,j.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new j.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&j.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(j.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(j.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(j.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(j.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=j.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),j.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{j.Events.enable()}},mutationToDom:function(t){var e=j.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i<this.argumentVarModels_.length;i++){var n=j.utils.xml.createElement("arg"),s=this.argumentVarModels_[i];n.setAttribute("name",s.name),n.setAttribute("varid",s.getId()),t&&this.paramIds_&&n.setAttribute("paramId",this.paramIds_[i]),e.appendChild(n)}return this.hasStatements_||e.setAttribute("statements","false"),e},domToMutation:function(t){this.arguments_=[],this.argumentVarModels_=[];for(var e,i=0;e=t.childNodes[i];i++)if("arg"==e.nodeName.toLowerCase()){var n=e.getAttribute("name"),s=e.getAttribute("varid")||e.getAttribute("varId");this.arguments_.push(n);var o=j.Variables.getOrCreateVariablePackage(this.workspace,s,n,"");null!=o?this.argumentVarModels_.push(o):console.log("Failed to create a variable with name "+n+", ignoring.")}this.updateParams_(),j.Procedures.mutateCallers(this),this.setStatements_("false"!==t.getAttribute("statements"))},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const t=Object.create(null);if(this.argumentVarModels_.length){t.params=[];for(let e=0;e<this.argumentVarModels_.length;e++)t.params.push({name:this.argumentVarModels_[e].name,id:this.argumentVarModels_[e].getId()})}return this.hasStatements_||(t.hasStatements=!1),t},loadExtraState:function(t){if(this.arguments_=[],this.argumentVarModels_=[],t.params)for(let e=0;e<t.params.length;e++){const i=t.params[e],n=j.Variables.getOrCreateVariablePackage(this.workspace,i.id,i.name,"");this.arguments_.push(n.name),this.argumentVarModels_.push(n)}this.updateParams_(),j.Procedures.mutateCallers(this),this.setStatements_(!1!==t.hasStatements)},decompose:function(t){var e=j.utils.xml.createElement("block");e.setAttribute("type","procedures_mutatorcontainer");var i=j.utils.xml.createElement("statement");i.setAttribute("name","STACK"),e.appendChild(i);for(var n=i,s=0;s<this.arguments_.length;s++){var o=j.utils.xml.createElement("block");o.setAttribute("type","procedures_mutatorarg");var _=j.utils.xml.createElement("field");_.setAttribute("name","NAME");var u=j.utils.xml.createTextNode(this.arguments_[s]);_.appendChild(u),o.appendChild(_);var r=j.utils.xml.createElement("next");o.appendChild(r),n.appendChild(o),n=r}var p=j.Xml.domToBlock(e,t);return"procedures_defreturn"==this.type?p.setFieldValue(this.hasStatements_,"STATEMENTS"):p.removeInput("STATEMENT_INPUT"),j.Procedures.mutateCallers(this),p},compose:function(t){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];for(var e=t.getInputTargetBlock("STACK");e&&!e.isInsertionMarker();){var i=e.getFieldValue("NAME");this.arguments_.push(i);var n=this.workspace.getVariable(i,"");this.argumentVarModels_.push(n),this.paramIds_.push(e.id),e=e.nextConnection&&e.nextConnection.targetBlock()}this.updateParams_(),j.Procedures.mutateCallers(this);var s=t.getFieldValue("STATEMENTS");if(null!==s&&(s="TRUE"==s,this.hasStatements_!=s))if(s)this.setStatements_(!0),this.statementConnection_&&this.statementConnection_.reconnect(this,"STACK"),this.statementConnection_=null;else{var o=this.getInput("STACK").connection;if(this.statementConnection_=o.targetConnection,this.statementConnection_){var _=o.targetBlock();_.unplug(),_.bumpNeighbours()}this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(t,e){var i=this.workspace.getVariableById(t);if(""==i.type){for(var n=i.name,s=this.workspace.getVariableById(e),o=!1,_=0;_<this.argumentVarModels_.length;_++)this.argumentVarModels_[_].getId()==t&&(this.arguments_[_]=s.name,this.argumentVarModels_[_]=s,o=!0);o&&(this.displayRenamedVar_(n,s.name),j.Procedures.mutateCallers(this))}},updateVarName:function(t){for(var e=t.name,i=!1,n=0;n<this.argumentVarModels_.length;n++)if(this.argumentVarModels_[n].getId()==t.getId()){var s=this.arguments_[n];this.arguments_[n]=e,i=!0}i&&(this.displayRenamedVar_(s,e),j.Procedures.mutateCallers(this))},displayRenamedVar_:function(t,e){this.updateParams_();const i=this.getIcon(j.icons.MutatorIcon.TYPE);if(i&&i.bubbleIsVisible())for(var n,s=i.getWorkspace().getAllBlocks(!1),o=0;n=s[o];o++)"procedures_mutatorarg"==n.type&&j.Names.equals(t,n.getFieldValue("NAME"))&&n.setFieldValue(e,"NAME")},customContextMenu:function(t){if(!this.isInFlyout){var e={enabled:!0},i=this.getFieldValue("NAME");e.text=j.Msg.PROCEDURES_CREATE_DO.replace("%1",i);var n=j.utils.xml.createElement("mutation");n.setAttribute("name",i);for(var s=0;s<this.arguments_.length;s++){var o=j.utils.xml.createElement("arg");o.setAttribute("name",this.arguments_[s]),n.appendChild(o)}var _=j.utils.xml.createElement("block");if(_.setAttribute("type",this.callType_),_.appendChild(n),e.callback=j.ContextMenu.callbackFactory(this,_),t.push(e),!this.isCollapsed())for(s=0;s<this.argumentVarModels_.length;s++){var u={enabled:!0},r=this.argumentVarModels_[s];u.text=j.Msg.VARIABLES_SET_CREATE_GET.replace("%1",r.name);var p=j.Variables.generateVariableFieldDom(r),a=j.utils.xml.createElement("block");a.setAttribute("type","variables_get"),a.appendChild(p),u.callback=j.ContextMenu.callbackFactory(this,a),t.push(u)}}},callType_:"procedures_callnoreturn"},Vn={init:function(){var t=j.Procedures.findLegalName("",this),e=new j.FieldTextInput(t,j.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new j.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&j.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(j.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(j.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(j.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:yn.setStatements_,updateParams_:yn.updateParams_,mutationToDom:yn.mutationToDom,domToMutation:yn.domToMutation,decompose:yn.decompose,compose:yn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:yn.getVars,getVarModels:yn.getVarModels,renameVarById:yn.renameVarById,updateVarName:yn.updateVarName,displayRenamedVar_:yn.displayRenamedVar_,customContextMenu:yn.customContextMenu,callType_:"procedures_callreturn"},Bn={init:function(){this.appendDummyInput().appendField(j.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(j.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new j.FieldCheckbox("TRUE"),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(j.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},Gn={init:function(){var t=new j.FieldTextInput(j.Procedures.DEFAULT_ARG,this.validator_);t.oldShowEditorFn_=t.showEditor_;t.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(j.Msg.PROCEDURES_BEFORE_PARAMS).appendField(t,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(j.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,t.onFinishEditing_=this.deleteIntermediateVars_,t.createdVariables_=[],t.onFinishEditing_("x")},validator_:function(t){var e=this.getSourceBlock(),i=e.workspace.getRootWorkspace();if(!(t=t.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"")))return null;for(var n=(e.workspace.targetWorkspace||e.workspace).getAllBlocks(!1),s=t.toLowerCase(),o=0;o<n.length;o++)if(n[o].id!=this.getSourceBlock().id){var _=n[o].getFieldValue("NAME");if(_&&_.toLowerCase()==s)return null}if(e.isInFlyout)return t;var u=i.getVariable(t,"");return u&&u.name!=t&&i.renameVariableById(u.getId(),t),u||(u=i.createVariable(t,""))&&this.createdVariables_&&this.createdVariables_.push(u),t},deleteIntermediateVars_:function(t){var e=this.getSourceBlock().workspace.getRootWorkspace();if(e)for(var i=0;i<this.createdVariables_.length;i++){var n=this.createdVariables_[i];n.name!=t&&e.deleteVariableById(n.getId())}}},Un={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(j.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(t,e){if(j.Names.equals(t,this.getProcedureCall())){this.setFieldValue(e,"NAME");var i=this.outputConnection?j.Msg.PROCEDURES_CALLRETURN_TOOLTIP:j.Msg.PROCEDURES_CALLNORETURN_TOOLTIP;this.setTooltip(i.replace("%1",e))}},setProcedureParameters_:function(t,e){const i=j.Procedures.getDefinition(this.getProcedureCall(),this.workspace),n=i&&i.getIcon(j.icons.MutatorIcon.TYPE),s=n&&n.bubbleIsVisible();if(s?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null),t.join("\n")!==this.arguments_.join("\n")){if(e.length!==t.length)throw Error("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let t=0;t<this.arguments_.length;t++){const i=this.getInput("ARG"+t);if(i){const n=i?.connection?.targetConnection;this.quarkConnections_[this.quarkIds_[t]]=n,s&&n&&!e.includes(this.quarkIds_[t])&&(n.disconnect(),n.getSourceBlock().bumpNeighbours())}}this.arguments_=[].concat(t),this.argumentVarModels_=[];for(var o=0;o<this.arguments_.length;o++){var _=j.Variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[o],"");this.argumentVarModels_.push(_)}if(this.updateShape_(),this.quarkIds_=e,this.quarkIds_)for(let t=0;t<this.arguments_.length;t++){const e=this.quarkIds_[t];if(e in this.quarkConnections_){const i=this.quarkConnections_[e];i?.reconnect(this,"ARG"+t)||delete this.quarkConnections_[e]}}}else this.quarkIds_=e},updateShape_:function(){for(var t=0;t<this.arguments_.length;t++){var e=this.getField("ARGNAME"+t);if(e){j.Events.disable();try{e.setValue(this.arguments_[t])}finally{j.Events.enable()}}else{e=new j.FieldLabel(this.arguments_[t]),this.appendValueInput("ARG"+t).setAlign(j.inputs.Align.RIGHT).appendField(e,"ARGNAME"+t).init()}}for(;this.getInput("ARG"+t);)this.removeInput("ARG"+t),t++;var i=this.getInput("TOPROW");i&&(this.arguments_.length?this.getField("WITH")||(i.appendField(j.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),i.init()):this.getField("WITH")&&i.removeField("WITH"))},mutationToDom:function(){var t=j.utils.xml.createElement("mutation");t.setAttribute("name",this.getProcedureCall());for(var e=0;e<this.arguments_.length;e++){var i=j.utils.xml.createElement("arg");i.setAttribute("name",this.arguments_[e]),t.appendChild(i)}return t},domToMutation:function(t){var e=t.getAttribute("name");this.renameProcedure(this.getProcedureCall(),e);for(var i,n=[],s=[],o=0;i=t.childNodes[o];o++)"arg"==i.nodeName.toLowerCase()&&(n.push(i.getAttribute("name")),s.push(i.getAttribute("paramId")));this.setProcedureParameters_(n,s)},saveExtraState:function(){const t=Object.create(null);return t.name=this.getProcedureCall(),this.arguments_.length&&(t.params=this.arguments_),t},loadExtraState:function(t){this.renameProcedure(this.getProcedureCall(),t.name);const e=t.params;if(e){const t=[];t.length=e.length,t.fill(null),this.setProcedureParameters_(e,t)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(t){if(this.workspace&&!this.workspace.isFlyout&&t.recordUndo)if(t.type==j.Events.BLOCK_CREATE&&-1!=t.ids.indexOf(this.id)){var e=this.getProcedureCall();if((d=j.Procedures.getDefinition(e,this.workspace))&&d.type!=this.defType_&&(d=null),d){if(JSON.stringify(d.getVars())!=JSON.stringify(this.arguments_)){let t=d.arguments_,e=[];for(var i=0;i<this.arguments_.length;i++){var n=this.getInput("ARG"+i);if(n){var s=n.connection.targetConnection;s?e.push(s.sourceBlock_.id):e.push(null)}}this.setProcedureParameters_(t,e)}}else{j.Events.setGroup(t.group);var o=j.utils.xml.createElement("xml"),_=j.utils.xml.createElement("block");_.setAttribute("type",this.defType_);var u=this.getRelativeToSurfaceXY(),r=u.x+j.SNAP_RADIUS*(this.RTL?-1:1),p=u.y+2*j.SNAP_RADIUS;_.setAttribute("x",r),_.setAttribute("y",p);var a=this.mutationToDom();_.appendChild(a);var l=j.utils.xml.createElement("field");l.setAttribute("name","NAME");var I=this.getProcedureCall();I||(I=j.Procedures.findLegalName("",this),this.renameProcedure("",I)),l.appendChild(j.utils.xml.createTextNode(I)),_.appendChild(l),o.appendChild(_),j.Xml.domToWorkspace(o,this.workspace),j.Events.setGroup(!1)}}else if(t.type==j.Events.BLOCK_DELETE){e=this.getProcedureCall();(d=j.Procedures.getDefinition(e,this.workspace))||(j.Events.setGroup(t.group),this.dispose(!0),j.Events.setGroup(!1))}else if(t.type==j.Events.CHANGE&&"disabled"==t.element){var d;e=this.getProcedureCall();if((d=j.Procedures.getDefinition(e,this.workspace))&&d.id==t.blockId){var T=j.Events.getGroup();T&&console.log("Saw an existing group while responding to a definition change"),j.Events.setGroup(t.group),t.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),j.Events.setGroup(T)}}},customContextMenu:function(t){if(this.workspace.isMovable()){var e={enabled:!0};e.text=j.Msg.PROCEDURES_HIGHLIGHT_DEF;var i=this.getProcedureCall(),n=this.workspace;e.callback=function(){var t=j.Procedures.getDefinition(i,n);t&&(n.centerOnBlock(t.id),t.select())},t.push(e)}},defType_:"procedures_defnoreturn"},wn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(j.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:Un.getProcedureCall,renameProcedure:Un.renameProcedure,setProcedureParameters_:Un.setProcedureParameters_,updateShape_:Un.updateShape_,mutationToDom:Un.mutationToDom,domToMutation:Un.domToMutation,getVars:Un.getVars,getVarModels:Un.getVarModels,onchange:Un.onchange,customContextMenu:Un.customContextMenu,defType_:"procedures_defreturn"},kn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(j.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(j.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(j.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var t=j.utils.xml.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(j.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]},xn={init:function(){this.setStyle("procedure_blocks"),this.appendValueInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.hasReturnValue_=!0},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(j.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(j.Msg.PROCEDURES_IFRETURN_WARNING)},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn","method_procedures_defnoreturn","method_procedures_defreturn"]},Hn=195,Wn={init:function(){this.setColour(Hn),this.appendDummyInput("").appendField(new j.FieldTextInput("mytup"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new j.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(j.Msg.TUPLE_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("tuple_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kn={init:function(){this.setColour(Hn),this.appendDummyInput().appendField(j.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Jn={init:function(){this.setColour(Hn),this.appendDummyInput().appendField(j.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Qn={init:function(){this.setColour(Hn),this.appendDummyInput("").appendField(new j.FieldTextInput("mytup"),"VAR").appendField(" = (").appendField(new j.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jn={init:function(){this.setColour(Hn),this.appendDummyInput("").appendField("(").appendField(new j.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},qn={init:function(){this.setColour(Hn),this.setOutput(!0),this.appendValueInput("TUP").setCheck("Tuple"),this.appendValueInput("AT").setCheck(Number).appendField(j.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(j.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(j.Msg.TUPLE_GET_INDEX_TOOLTIP)}},zn={init:function(){this.setColour(Hn),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(j.Msg.MIXLY_LENGTH),this.setTooltip(j.Msg.TUPLE_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Zn={init:function(){this.setColour(Hn),this.appendValueInput("TUP").setCheck("Tuple"),this.appendDummyInput("").appendField(j.Msg.TUPLE_DEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.TUPLE_DEL_TOOLTIP)}},$n={init:function(){this.setColour(Hn),this.appendValueInput("TUP1").setCheck("Tuple"),this.appendDummyInput("").appendField(j.Msg.TUPLE_JOIN),this.appendValueInput("TUP2").setCheck("Tuple"),this.setInputsInline(!0),this.setTooltip(j.Msg.TUPLE_JOIN_TOOLTIP),this.setOutput(!0,"Tuple")}},ts={init:function(){this.appendValueInput("TUP").setCheck("Tuple");var t=[[j.Msg.blockpy_TUPLE_MAX,"max"],[j.Msg.blockpy_TUPLE_MIN,"min"],[j.Msg.MATH_ONLIST_OPERATOR_SUM,"sum"]];this.setColour(Hn),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_GET).appendField(new j.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{max:j.Msg.MIXLY_TOOLTIP_TUPLE_MAX,min:j.Msg.MIXLY_TOOLTIP_TUPLE_MIN,sum:j.Msg.MIXLY_TOOLTIP_TUPLE_SUM}[t]}))}},es={init:function(){var t=[[j.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Hn),this.appendValueInput("VAR").setCheck("Tuple"),this.appendDummyInput("").appendField(j.Msg.A_TO_B).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{list:j.Msg.TUPLE_TO_LISTS,set:j.Msg.TUPLE_TO_SET}[t]}))}},is={init:function(){var t=[[j.Msg.MIXLY_LIST_INDEX,"INDEX"],[j.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Hn),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(j.Msg.HTML_VALUE),this.appendDummyInput().appendField(j.Msg.MIXLY_DE).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:j.Msg.MIXLY_TOOLTIP_TUPLE_FIND_INDEX,COUNT:j.Msg.MIXLY_TOOLTIP_TUPLE_FIND_COUNT}[t]}))}},ns={init:function(){var t=[[j.Msg.MIXLY_LIST_LEN,"LEN"],[j.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[j.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[j.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[j.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[j.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[j.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[j.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Hn),this.setOutput(!0,Number),this.appendValueInput("data").setCheck("List"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:j.Msg.TUPLE_LENGTH_TOOLTIP,SUM:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_SUM,MAX:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MAX,MIN:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MIN,AVERAGE:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_AVERAGE,MEDIAN:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MEDIAN,MODE:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MODE,STD_DEV:j.Msg.MATH_ONLIST_TOOLTIP_TUPLE_STD_DEV}[t]}))}},ss={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(Hn),this.appendValueInput("LIST").setCheck("List"),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.PYTHON_TUPLE_GET_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_CHARAT_TAIL&&this.appendDummyInput("ORDINAL"+t).appendField(j.Msg.TEXT_CHARAT_TAIL)):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"))}},os={init:function(){this.setColour(Hn),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"Tuple"),this.setMutator(new j.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(j.Msg.TUPLE_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("tuple_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},_s={init:function(){this.setHelpUrl(j.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Hn),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(j.Msg.TEXT_CHARAT_TAIL+" "+j.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(j.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Tuple"),this.setTooltip(j.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)}},us={init:function(){this.setColour(Hn),this.appendValueInput("TUP"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+j.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(j.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},rs={init:function(){this.setColour(Hn),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TOTUPLE),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TOTUPLE)}};const ps={init:function(){var t;this.setColour(Hn),this.appendDummyInput("").appendField("(").appendField(new j.FieldTextInput((t=new Date,t.getFullYear()+","+(t.getMonth()+1)+","+t.getDate()+","+t.getHours()+","+t.getMinutes()+","+t.getSeconds())),"CONTENT").appendField(")"),this.setOutput(!0)}},as={init:function(){this.setColour(Hn),this.appendValueInput("params").appendField("(").appendField(j.Msg.MIXLY_NAME_OF_PARAMS),this.appendDummyInput().appendField(",").appendField(j.Msg.MIXLY_TYPE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_TYPE_BOOLEAN,"boolean"],[j.Msg.MIXLY_TYPE_STRING,"string"],[j.Msg.MIXLY_TYPE_NUMBER,"number"],[j.Msg.MIXLY_TYPE_INTEGER,"integer"],[j.Msg.MIXLY_TYPE_NULL,"null"]]),"type"),this.appendValueInput("des").appendField(",").appendField(j.Msg.MIXLY_DESCRIPTION),this.appendDummyInput().appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},ls=100,Is={init:function(){this.setColour(ls),this.appendDummyInput("").appendField(new j.FieldTextInput("s1"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new j.icons.MutatorIcon(["set_create_with_item"],this)),this.setTooltip(j.Msg.blockpy_SET_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("set_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("set_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(j.Msg.blockpy_SET_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(j.Msg.blockpy_SET_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ds={init:function(){this.setColour(ls),this.appendDummyInput().appendField(j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(j.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ts={init:function(){this.setColour(ls),this.appendDummyInput().appendField(j.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.blockpy_SET_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},hs={init:function(){this.setColour(ls),this.appendValueInput("SET"),this.appendDummyInput("").appendField(j.Msg.MIXLY_LENGTH),this.setInputsInline(!0),this.setTooltip(j.Msg.SET_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Ms={init:function(){this.setColour(ls),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(j.Msg.blockpy_SET_GET_AND_REMOVE_LAST),this.setTooltip(j.Msg.SET_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},ms={init:function(){this.setColour(ls),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(j.Msg.SET_CLEAR),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Os={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[j.Msg.blockpy_set_union,"union"],[j.Msg.blockpy_set_intersection,"intersection"],[j.Msg.blockpy_set_difference,"difference"]];this.setColour(ls),this.appendDummyInput("").appendField(j.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(j.Msg.blockpy_set_get_operate).appendField(new j.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,"set");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{union:j.Msg.MIXLY_TOOLTIP_SET_UNION,intersection:j.Msg.MIXLY_TOOLTIP_SET_INTERSECTION,difference:j.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE}[t]}))}},cs={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[j.Msg.blockpy_set_union,"update"],[j.Msg.blockpy_set_intersection,"intersection_update"],[j.Msg.blockpy_set_difference,"difference_update"]];this.setColour(ls),this.appendDummyInput("").appendField(j.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(j.Msg.blockpy_set_get_operate).appendField(new j.FieldDropdown(t),"OPERATE"),this.appendDummyInput("").appendField(j.Msg.blockpy_set_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{update:j.Msg.MIXLY_TOOLTIP_SET_UPDATE,intersection_update:j.Msg.MIXLY_TOOLTIP_SET_INTERSECTION_UPDATE,difference_update:j.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE_UPDATE}[t]}))}},Es={init:function(){this.appendValueInput("SET").setCheck("Set");var t=[[j.Msg.MIXLY_blockpy_set_add,"add"],[j.Msg.MIXLY_blockpy_set_discard,"discard"]];this.setColour(ls),this.appendDummyInput("").appendField(new j.FieldDropdown(t),"OPERATE"),this.appendValueInput("data").appendField(j.Msg.blockpy_SET_VARIABLES_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{add:j.Msg.SET_ADD_TOOLTIP,discard:j.Msg.SET_DISCARD_TOOLTIP}[t]}))}},Rs={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[j.Msg.blockpy_set_sub,"issubset"],[j.Msg.blockpy_set_super,"issuperset"]];this.setColour(ls),this.appendDummyInput("").appendField(j.Msg.blockpy_is_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(j.Msg.blockpy_set_of).appendField(new j.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,Boolean);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{issubset:j.Msg.MIXLY_TOOLTIP_SET_SUB,issuperset:j.Msg.MIXLY_TOOLTIP_SET_SUPER}[t]}))}},gs={init:function(){this.appendValueInput("SET").setCheck("Set"),this.setColour(ls),this.appendValueInput("VAR").setCheck([String,"List"]).appendField(j.Msg.blockpy_set_add_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.SET_UPDATE_TOOLTIP)}},Cs={init:function(){this.setColour(ls),this.appendDummyInput("").appendField("{").appendField(new j.FieldTextInput("0,0,0"),"TEXT").appendField("}"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXPY_TOOLTIP_SET_CREATE_WITH_TEXT)}},As={init:function(){this.setColour(ls),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_TOSET),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_PYTHON_TOOLTIP_TOSET)}},Ls="#1ec1e4",Ss={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(j.Msg.HTML_DOCUMENT),this.appendStatementInput("HEAD").appendField(j.Msg.HTML_HEAD),this.appendStatementInput("BODY").appendField(j.Msg.HTML_BODY),this.setOutput(!0)}},fs={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(j.Msg.HTML_LEVEL).appendField(new j.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ds={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(new j.FieldDropdown([[j.Msg.HTML_HEAD,"head"],[j.Msg.HTML_BODY,"body"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ns={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(new j.FieldDropdown([[j.Msg.HTML_P,"p"],[j.Msg.HTML_SPAN,"span"],[j.Msg.HTML_FORM,"form"],[j.Msg.HTML_TABLE,"table"],[j.Msg.HTML_LINE,"tr"],[j.Msg.HTML_CELL,"td"],[j.Msg.HTML_OL,"ol"],[j.Msg.HTML_UL,"ul"],[j.Msg.HTML_LI,"li"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ps={init:function(){this.setColour(Ls),this.appendDummyInput().appendField("<").appendField(new j.FieldTextInput("tag"),"LEVEL").appendField(">"),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)}},Fs={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(j.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},vs={init:function(){this.setColour(Ls),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)}},Ys={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(new j.FieldTextInput("property"),"KEY").appendField(":").appendField(new j.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bs={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(new j.FieldTextInput("property"),"KEY").appendField(":").appendField(new j.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Ls),this.appendDummyInput().appendField(j.Msg.HTML_TEXT).appendField(new j.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ys=160,Vs={init:function(){this.setColour(ys),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new j.FieldTable(""),"TEXT")}},Bs={init:function(){this.setColour(ys),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new j.FieldMultilineInput(""),"TEXT")}},Gs={init:function(){this.setColour(ys),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new j.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Us={init:function(){this.setColour(ys),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},ws={init:function(){this.setColour(ys),this.appendDummyInput().appendTitle("Comment:").appendTitle(new j.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},ks={init:function(){this.setColour(ys),this.appendValueInput("VALUE").appendField(j.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},xs={init:function(){this.setColour(ys),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<this.itemCount_;n++){var s=t.newBlock("text_print_multiple_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("PRINT"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("PRINT"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("PRINT"+t);)this.removeInput("PRINT"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField("print");else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("PRINT"+t);0==t&&e.appendField("print")}}},Hs={init:function(){this.setColour(ys),this.appendDummyInput().appendField("print"),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}},Ws={init:function(){this.setColour(ys),this.appendDummyInput().appendField("item"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},Ks={init:function(){this.setColour(ys),this.itemCount_=1,this.hasReturn_=!1,this.appendDummyInput().appendField(new j.FieldTextInput("str"),"NAME"),this.updateShape_(),this.setMutator(new j.icons.MutatorIcon(["function_call_item"],this)),this.setTooltip("Can be used to call any function")},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t.setAttribute("hasReturn",this.hasReturn_?"TRUE":"FALSE"),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.hasReturn_="TRUE"===t.getAttribute("hasReturn"),this.updateShape_()},decompose:function(t){var e=j.Block.obtain(t,"function_call_container");e.initSvg(),e.setFieldValue(this.hasStatements_?"TRUE":"FALSE","RETURN");for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("function_call_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},setReturn:function(t){this.unplug(!0,!0),this.setOutput(t),this.setPreviousStatement(!t),this.setNextStatement(!t),this.rendered&&this.render()},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.hasReturn_="TRUE"===t.getFieldValue("RETURN"),this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ARGUMENT"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ARGUMENT"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ARGUMENT"+t);)this.removeInput("ARGUMENT"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ARGUMENT"+t);this.setReturn(this.hasReturn_)}},Js={init:function(){this.setColour(ys),this.appendDummyInput().appendField("Arguments"),this.appendStatementInput("STACK"),this.appendDummyInput().setAlign(j.inputs.Align.RIGHT).appendField("has return").appendField(new j.FieldCheckbox("TRUE"),"RETURN"),this.setTooltip(""),this.contextMenu=!1}},Qs={init:function(){this.setColour(ys),this.appendDummyInput().appendField("argument"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},js={init:function(){this.appendValueInput("MODULE").setCheck(null),this.appendValueInput("NAME").setCheck(null).appendField("."),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(230),this.setTooltip(""),this.setHelpUrl("")}},qs=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE),e.ORDER_ATOMIC]},zs=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"),j.Variables.NAME_TYPE)+" = "+i+"\n"},Zs=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]},$s=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},to=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},eo=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},io=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"[]";return[i="zip("+i.join(", ")+")",e.ORDER_ATOMIC]},no=function(t,e){const i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"[]";return[`${this.getFieldValue("TYPE")}(${i})`,e.ORDER_ATOMIC]},so=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},oo=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},_o=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},uo=function(t,e){var i=1,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},ro=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),u=(_=e.addLoopTrap(_,t.id)||e.PASS,""),r=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},p=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+r()+"("+t+", "+e+", "+i+") or "+p()+"("+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<s?r():p(),t+="("+n+", "+s+", "+o+")");else{var a=function(t,n){if(j.isNumber(t))t=parseFloat(t);else{var s=e.variableDB_.getDistinctName(i+n,j.Variables.NAME_TYPE);u+=s+" = "+t+"\n",t=s}return t};n=a(n,"_start"),s=a(s,"_end");a(o,"_inc"),t="number"==typeof n&&"number"==typeof s?n<s?r(0,s):p(0,s):t(n,s,o)}return u+="for "+i+" in "+t+":\n"+_},po=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),u=e.addLoopTrap(_,t.id)||e.PASS;return e.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+i+" in mixly_range("+n+", "+s+", "+o+"):\n"+u},ao=function(t,e){var i="UNTIL"==t.getFieldValue("MODE"),n=e.valueToCode(t,"BOOL",e.ORDER_NONE)||"False",s=e.statementToCode(t,"DO");return i&&(n="not "+n),"while "+n+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},lo=function(t){switch(t.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},Io=function(t,e){return"sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},To=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},ho=function(t,e){e.definitions_.import_time="import time";return["time.time()",e.ORDER_ATOMIC]},Mo=function(t,e){return e.definitions_.import_microbit="from microbit import *","reset()\n"},mo=function(){return"interrupts();\n"},Oo=function(){return"noInterrupts();\n"},co=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"''",n=e.valueToCode(t,"LIST",e.ORDER_RELATIONAL)||"[]",s=e.statementToCode(t,"DO");return"for "+i+" in "+n+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},Eo=function(t,e){return["range("+(e.valueToCode(this,"FROM",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"TO",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"STEP",e.ORDER_NONE)||"1")+")",e.ORDER_ATOMIC]},Ro=function(t,e){var i="lambda "+(e.valueToCode(t,"BOOL",e.ORDER_NONE)||"None")+": "+(e.statementToCode(t,"DO")||"pass");return[i=i.replace("\n","").replace(" ",""),e.ORDER_ATOMIC]},go=function(t,e){return e.definitions_.import_time="import time","time.sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Co=function(){return"pass\n"},Ao=function(t,e){e.definitions_.import__thread="import _thread";var i=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return"_thread.start_new_thread("+e.variableDB_.getName(e.valueToCode(this,"callback",e.ORDER_NONE)||"None",j.Procedures.NAME_TYPE)+", "+i+")\n"},Lo=function(t,e){var i=e.valueToCode(this,"select_data",e.ORDER_NONE)||"False",n=e.statementToCode(this,"input_data");return n="true"==this.getFieldValue("type")?n+" if ("+i+"):\n break\n":n+" if not ("+i+"):\n break\n","while True:\n"+(n=e.addLoopTrap(n,this.id)||e.PASS)},So=function(t,e){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)},fo=function(t,e){e.definitions_.import_gc="import gc";return"gc.collect()\n"},Do=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_alloc()",e.ORDER_ATOMIC]},No=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_free()",e.ORDER_ATOMIC]},Po=function(t,e){e.definitions_.import_machine="import machine";return["machine.unique_id()",e.ORDER_ATOMIC]},Fo=So,vo=function(t,e){return e.definitions_.import_datetime="import datetime",["datetime.datetime.fromtimestamp("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Yo=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"uuid"]="from "+i+" import uuid";return["uuid()",e.ORDER_ATOMIC]},bo=function(t,e){var i=this.getFieldValue("NUM");return[i,i<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},Xo=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},yo=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},Vo=function(t,e){var i=this.getFieldValue("OP"),n=e.ORDER_ATOMIC;return["("+(e.valueToCode(this,"A",n)||"0")+i+(e.valueToCode(this,"B",n)||"0")+")",n]},Bo=function(t,e){var i=(n={ADD:[" + ",e.ORDER_ADDITIVE],MINUS:[" - ",e.ORDER_ADDITIVE],MULTIPLY:[" * ",e.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",e.ORDER_MULTIPLICATIVE],QUYU:[" % ",e.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",e.ORDER_MULTIPLICATIVE],POWER:[" ** ",e.ORDER_EXPONENTIATION]}[t.getFieldValue("OP")])[0],n=n[1];return[(e.valueToCode(t,"A",n)||"0")+i+(t=e.valueToCode(t,"B",n)||"0"),n]},Go=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0",n=e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var s="+=";break;case"MINUS":s="-=";break;case"MULTIPLY":s="*=";break;case"DIVIDE":s="/=";break;case"QUYU":s="%=";break;case"ZHENGCHU":s="//=";break;case"POWER":s="**="}return i+" "+s+" "+n+"\n"},Uo=function(t,e){var i,n=t.getFieldValue("OP");if("NEG"==n)return["-"+(i=e.valueToCode(t,"NUM",e.ORDER_UNARY_SIGN)||"0"),e.ORDER_UNARY_SIGN];switch(e.definitions_.import_math="import math",t="SIN"==n||"COS"==n||"TAN"==n?e.valueToCode(t,"NUM",e.ORDER_MULTIPLICATIVE)||"0":e.valueToCode(t,"NUM",e.ORDER_NONE)||"0",n){case"ABS":i="math.fabs("+t+")";break;case"ROOT":i="math.sqrt("+t+")";break;case"LN":i="math.log("+t+")";break;case"LOG10":i="math.log10("+t+")";break;case"EXP":i="math.exp("+t+")";break;case"POW10":i="math.pow(10,"+t+")";break;case"ROUND":i="round("+t+")";break;case"ROUNDUP":i="math.ceil("+t+")";break;case"ROUNDDOWN":i="math.floor("+t+")";break;case"SIN":i="math.sin("+t+")";break;case"COS":i="math.cos("+t+")";break;case"TAN":i="math.tan("+t+")";break;case"++":i="++("+t+")";break;case"--":i="--("+t+")";break;case"-":i="-("+t+")"}if(i)return[i,e.ORDER_EXPONENTIATION];switch(n){case"ASIN":i="math.degrees(math.asin("+t+"))";break;case"ACOS":i="math.degrees(math.acos("+t+"))";break;case"ATAN":i="math.degrees(math.atan("+t+"))"}return[i,e.ORDER_MULTIPLICATIVE]},wo=Uo,ko=function(t,e){var i=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+i+")",e.ORDER_ATOMIC]},xo=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_NONE)||"0",n=this.getFieldValue("OP"),s="";return"round"===n?s=n+"("+i+")":(s="math."+n+"("+i+")",e.definitions_.import_math="import math"),[s,e.ORDER_ATOMIC]},Ho=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_NONE)||"0",n=e.valueToCode(this,"B",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+i+", "+n+")",e.ORDER_ATOMIC]},Wo=function(t,e){e.definitions_.import_random="import random";var i=this.getFieldValue("TYPE"),n=e.valueToCode(this,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(this,"TO",e.ORDER_NONE)||"0";if("int"==i)var o="random.randint("+n+", "+s+")";else if("float"==i)o="random.uniform("+n+", "+s+")";return[o,e.ORDER_UNARY_POSTFIX]},Ko=function(t,e){var i=e.valueToCode(this,"NUM",e.ORDER_NONE),n=e.valueToCode(this,"fromLow",e.ORDER_ATOMIC),s=e.valueToCode(this,"fromHigh",e.ORDER_ATOMIC),o=e.valueToCode(this,"toLow",e.ORDER_ATOMIC),_=e.valueToCode(this,"toHigh",e.ORDER_ATOMIC);return e.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+i+", "+n+", "+s+", "+o+", "+_+")",e.ORDER_NONE]},Jo=function(t,e){return["min(max("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"LOW",e.ORDER_NONE)||"0")+"), "+(e.valueToCode(this,"HIGH",e.ORDER_NONE)||"0")+")",e.ORDER_UNARY_POSTFIX]},Qo=function(t,e){var i=t.getFieldValue("OP"),n=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0",s=t.getFieldValue("OP2");e.definitions_.import_math="import math";var o="",_="10";if("two"==i?_="2":"eight"==i?_="8":"ten"==i?_="10":"sixteen"==i&&(_="16"),"two"==s?o="bin":"eight"==s?o="oct":"ten"==s?o="":"sixteen"==s&&(o="hex"),""==o)var u="int(str("+n+"), "+_+")";else u=o+"(int(str("+n+"), "+_+"))";return[u,e.ORDER_ATOMIC]},jo=function(t,e){return e.definitions_.import_random="import random","random.seed("+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+");\n"},qo=function(t,e){var i=this.getFieldValue("NUM");return[i,i<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},zo=function(t,e){return["round("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"VAR",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},Zo=function(t,e){var i=this.getFieldValue("TOWHAT"),n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==i?[n+'.encode("utf-8")',e.ORDER_ATOMIC]:"bti"==i?["int.from_bytes("+n+',"big")',e.ORDER_ATOMIC]:[i+"("+n+")",e.ORDER_ATOMIC]},$o=function(t,e){var i=this.getFieldValue("TOWHAT"),n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==i?[n+'.encode("utf-8")',e.ORDER_ATOMIC]:[i+"("+n+")",e.ORDER_ATOMIC]},t_=Ko,e_=function(t,e){return e.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+").decode()",e.ORDER_ATOMIC]},i_=function(t,e){e.definitions_.import_itertools="import itertools";let i=e.valueToCode(this,"REPEAT",e.ORDER_ATOMIC),n=new Array(this.itemCount_);for(let t=0;t<this.itemCount_;t++)n[t]=e.valueToCode(this,`ADD${t}`,e.ORDER_NONE)||"0";let s="";return this.itemCount_&&(s=`itertools.product(${n.join(", ")}, repeat=${i})`),[s,e.ORDER_ATOMIC]},n_=function(t,e){return e.definitions_.import_math="import math",["math.degrees("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},s_=function(t,e){return e.definitions_.import_math="import math",["math.radians("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},o_=function(t,e){return[e.quote_(this.getFieldValue("TEXT")),e.ORDER_ATOMIC]},__=function(t,e){return['"""'+this.getFieldValue("VALUE")+'"""',e.ORDER_ATOMIC]},u_=function(t,e){return[`b'${this.getFieldValue("TEXT")}'`,e.ORDER_ATOMIC]},r_=function(t,e){return["'"+this.getFieldValue("TEXT")+"'",e.ORDER_ATOMIC]},p_=function(t,e){return[e.valueToCode(this,"A",e.ORDER_ATOMIC)+" + "+e.valueToCode(this,"B",e.ORDER_ATOMIC),e.ORDER_ADDITIVE]},a_=function(t,e){return["chr("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},l_=function(t,e){return["ord("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"a")+")",e.ORDER_ATOMIC]},I_=function(t,e){return["str("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},d_=function(t,e){return["len("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},T_=function(t,e){var i=t.getFieldValue("WHERE")||"FROM_START",n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';switch(i){case"FROM_START":return[n+"["+(t=e.getAdjustedInt(t,"AT"))+"]",e.ORDER_ATOMIC];case"FROM_END":return[n+"["+(t=e.getAdjustedInt(t,"AT",1,!0))+"]",e.ORDER_ATOMIC];case"RANDOM":return e.definitions_.import_random="import random",["random.choice("+n+")",e.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},h_=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+(e.valueToCode(this,"AT",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},M_=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';return e.definitions_.import_random="import random",["random.choice("+i+")",e.ORDER_FUNCTION_CALL]},m_=function(t,e){var i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""',n=e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""',s=this.getFieldValue("DOWHAT");return"==="===s?[i+" == "+n,e.ORDER_ATOMIC]:[i+"."+s+"("+n+")",e.ORDER_ATOMIC]},O_=function(t,e){return["cmp("+(e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},c_=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',n=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(n){case"FROM_START":"0"==(o=e.getAdjustedInt(t,"AT1"))&&(o="");break;case"FROM_END":var o=e.getAdjustedInt(t,"AT1",0,!0);break;case"FIRST":o="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var _=e.getAdjustedInt(t,"AT2");break;case"FROM_END":_=e.getAdjustedInt(t,"AT2",0,!0);j.isNumber(String(_))?"0"==_&&(_=""):(e.definitions_.import_sys="import sys",_+=" or sys.maxsize");break;case"LAST":_="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[i+"["+o+" : "+_+"]",e.ORDER_ATOMIC]},E_=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+e.valueToCode(this,"AT1",e.ORDER_ATOMIC)+" : "+e.valueToCode(this,"AT2",e.ORDER_ATOMIC)+"]",e.ORDER_ATOMIC]},R_=function(t,e){var i=this.getFieldValue("CAPITAL");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},g_=function(t,e){var i=this.getFieldValue("CENTER");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"WID",e.ORDER_ATOMIC)+","+e.valueToCode(this,"Symbol",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},C_=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".find("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},A_=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".join("+(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},L_=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".replace("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},S_=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+".split("+(e.valueToCode(this,"VAL",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},f_=function(t,e){var i=this.getFieldValue("TOWHAT");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},D_=function(t,e){for(var i=this.getFieldValue("VAR"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[n=i+".format("+n.join(", ")+")",e.ORDER_ATOMIC]},N_=function(t,e){for(var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[n=i+".format("+n.join(", ")+")",e.ORDER_ATOMIC]},P_=E_,F_=O_,v_=h_,Y_=function(t,e){var i=this.getFieldValue("DIR"),n=this.getFieldValue("CODE");return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"."+i+'("'+n+'")',e.ORDER_ATOMIC]},b_=function(t,e){return["eval("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},X_=function(t,e){return e.definitions_.import_os="import os","os.system("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},y_=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)+" : "+e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)+"]",e.ORDER_ATOMIC]},V_=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row",e.ORDER_ATOMIC)||0)+","+(e.valueToCode(this,"col",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},B_=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"row_end",e.ORDER_ATOMIC)||1)+","+(e.valueToCode(this,"col_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"col_end",e.ORDER_ATOMIC)||1)+"]",e.ORDER_ATOMIC]},G_=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return n=i+" = ["+n.join(", ")+"]\n"},U_=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE)+" = ["+this.getFieldValue("TEXT")+"]\n"},w_=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||0)+"]",e.ORDER_ATOMIC]},k_=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+"] = "+(e.valueToCode(this,"TO",e.ORDER_ASSIGNMENT)||"0")+"\n"},x_=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return i+"."+this.getFieldValue("OP")+"("+n+")\n"},H_=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+")",e.ORDER_ATOMIC]},W_=function(t,e){return e.definitions_.import_random="import random",["random.sample("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},K_=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+".insert("+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+", "+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")\n"},J_=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".reverse()\n"},Q_=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},j_=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==i)var o=n+".index("+s+")";else if("COUNT"==i)o=n+".count("+s+")";return[o,e.ORDER_ATOMIC]},q_=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return"del"==this.getFieldValue("OP")?"del "+i+"["+n+"]\n":i+".remove("+n+")\n"},z_=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+".pop("+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Z_=function(t,e){var i,n=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),n){case"LEN":i="len("+t+")";break;case"SUM":i="sum("+t+")";break;case"MIN":i="min("+t+")";break;case"MAX":i="max("+t+")";break;case"AVERAGE":e.definitions_.import_mixpy_math_mean="from mixpy import math_mean",i="math_mean("+t+")";break;case"MEDIAN":e.definitions_.import_mixpy_math_median="from mixpy import math_median",i="math_median("+t+")";break;case"MODE":e.definitions_.import_mixpy_math_modes="from mixpy import math_modes",i="math_modes("+t+")";break;case"STD_DEV":e.definitions_.import_mixpy_math_standard_deviation="from mixpy import math_standard_deviation",i="math_standard_deviation("+t+")";break;default:throw"Unknown operator: "+n}if(i)return[i,e.ORDER_ATOMIC]},$_=function(t,e){return e.definitions_.import_mixpy_lists_sort="from mixpy import lists_sort",["lists_sort("+(e.valueToCode(t,"LIST",e.ORDER_NONE)||"[]")+', "'+t.getFieldValue("TYPE")+'", '+("1"===t.getFieldValue("DIRECTION")?"False":"True")+")",e.ORDER_ATOMIC]},tu=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s="";return"array"==i?(e.definitions_.import_numpy="import numpy",s="numpy.array("+n+")"):s=i+"("+n+")",[s,e.ORDER_ATOMIC]},eu=function(t,e){return["["+this.getFieldValue("CONTENT")+"]",e.ORDER_ATOMIC]},iu=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0";return[i="["+i.join(", ")+"]",e.ORDER_ATOMIC]},nu=tu,su=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},ou=G_,_u=U_,uu=w_,ru=y_,pu=k_,au=K_,lu=q_,Iu=function(t,e){return["list("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},du=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+".tolist()",e.ORDER_ATOMIC]},Tu=function(t,e){return["enumerate("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+",start="+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},hu=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist";return[(e.valueToCode(this,"CON",e.ORDER_ASSIGNMENT)||"0")+" in "+i,e.ORDER_ATOMIC]},Mu=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++){var o=this.getFieldValue("KEY"+s);n[s]=o+":"+(e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0")}return n=i+"= {"+n.join(", ")+"}\n"},mu=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".keys()",e.ORDER_ATOMIC]},Ou=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);if("educore"==i)var o=n+".get("+s+")";else o=n+"["+s+"]";return[o,e.ORDER_ATOMIC]},cu=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".get("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Eu=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"] = "+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+"\n"},Ru=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"]\n"},gu=function(t,e){var i=e.valueToCode(this,"DICT2",e.ORDER_ASSIGNMENT)||"0";return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".update("+i+")\n"},Cu=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Au=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".items()",e.ORDER_ATOMIC]},Lu=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".values()",e.ORDER_ATOMIC]},Su=function(t,e){return["len("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},fu=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"\n"},Du=function(t,e){var i=e.valueToCode(t,"DICT",e.ORDER_MEMBER)||"[]",n=t.getFieldValue("WHERE"),s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);switch(n){case"INSERT":var o=i+"["+s+"] = "+(e.valueToCode(this,"AT2",e.ORDER_ASSIGNMENT)||"0")+"\n";break;case"DELETE":o="del "+i+"["+s+"]\n";break;default:throw"Unhandled option (lists_setIndex2)"}return o},Nu=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".pop("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+")",e.ORDER_ATOMIC]},Pu=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+".setdefault("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n"},Fu=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++){var s=this.getFieldValue("KEY"+n);i[n]=s+": "+(e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0")}return[i="{"+i.join(", ")+"}",e.ORDER_ATOMIC]},vu=function(t,e){return["dict("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Yu=function(t,e){return e.definitions_.import_json="import json",["json.dumps("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},bu=function(t,e){return e.definitions_.import_json="import json",["json.loads("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"null")+")",e.ORDER_ATOMIC]},Xu=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"["+(e.valueToCode(this,"VAR1",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR2",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR3",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR4",e.ORDER_ASSIGNMENT)||"null")+"]",e.ORDER_ATOMIC]},yu=function(t,e){return e.definitions_.import_json="import json",e.definitions_.import_ujson="import ujson",["ujson.loads("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Vu=function(t,e){var i=this.getFieldValue("OP"),n=Vu.OPERATORS[i],s="=="==n||"!="==n?e.ORDER_EQUALITY:e.ORDER_RELATIONAL;return[(e.valueToCode(this,"A",s)||"0")+" "+n+" "+(e.valueToCode(this,"B",s)||"0"),s]},Bu=function(t,e){var i=this.getFieldValue("OP1"),n=Vu.OPERATORS[i],s=this.getFieldValue("OP2"),o=Vu.OPERATORS[s];return[(e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0")+" "+n+" "+(e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0")+" "+o+" "+(e.valueToCode(this,"C",e.ORDER_RELATIONAL)||"0"),e.ORDER_RELATIONAL]};Vu.OPERATORS={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="};const Gu=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]},Uu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},wu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ku=function(t,e){return["None",e.ORDER_ATOMIC]},xu=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]},Hu=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]},Wu=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]},Ku=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Ju=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Qu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ju=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},qu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},zu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Zu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},$u=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]},tr=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},er=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ir=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},nr=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},sr=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},or=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},_r=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ur=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},rr=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"},pr=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ar=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},lr=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ir=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"},dr=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]},Tr=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"},hr=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"},Mr=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;_<this.arguments_.length;_++){var u=e.variableDB_.getName(this.arguments_[_],j.Variables.NAME_TYPE);o[_]=u}var r="def "+i+"("+o.join(", ")+"):\n"+n+s+"\n";return r=e.scrub_(this,r),e.setups_[i]=r,null},mr=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);for(var s=[],o=0;o<this.arguments_.length;o++){var _=e.variableDB_.getName(this.arguments_[o],j.Variables.NAME_TYPE);s[o]=_}var u="def "+i+"("+s.join(", ")+"):\n"+n+"\n";return u=e.scrub_(this,u),e.setups_[i]=u,null},Or=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("NAME"),j.Procedures.NAME_TYPE),n=[],s=0;s<this.arguments_.length;s++)n[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return[i+"("+n.join(", ")+")",e.ORDER_UNARY_POSTFIX]},cr=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("NAME"),j.Procedures.NAME_TYPE),n=[],s=0;s<this.arguments_.length;s++)n[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return i+"("+n.join(", ")+")\n"},Er=function(t,e){var i="if ("+(e.valueToCode(this,"CONDITION",e.ORDER_NONE)||"False")+") :\n";this.hasReturnValue_?i+=" return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):i+=" return None";return i+="\n"},Rr=function(t,e){var i="";this.hasReturnValue_?i+="return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):i+="return None";return i+="\n"},gr=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";if(1!=this.itemCount_)n=i+"= ("+n.join(", ")+")\n";else n=i+"= ("+n.join(", ")+",)\n";return n},Cr=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE)+"= ("+this.getFieldValue("TEXT")+")\n"},Ar=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},Lr=function(t,e){var i=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"1";return n.match(/^\d+$/)&&(n=parseInt(n,10)),[i+"["+n+"]",e.ORDER_ATOMIC]},Sr=function(t,e){return["len("+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},fr=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},Dr=function(t,e){return[(e.valueToCode(this,"TUP1",e.ORDER_ASSIGNMENT)||"0")+" + "+(e.valueToCode(this,"TUP2",e.ORDER_ASSIGNMENT)||"0"),e.ORDER_ATOMIC]},Nr=function(t,e){var i=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0";return[this.getFieldValue("DIR")+"("+i+")",e.ORDER_ATOMIC]},Pr=function(t,e){return[this.getFieldValue("OP")+"("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n",e.ORDER_ATOMIC]},Fr=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==i)var o=n+".index("+s+")";else if("COUNT"==i)o=n+".count("+s+")";return[o,e.ORDER_ATOMIC]},vr=function(t,e){var i,n=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),n){case"LEN":i="len("+t+")";break;case"SUM":i="sum("+t+")";break;case"MIN":i="min("+t+")";break;case"MAX":i="max("+t+")";break;case"AVERAGE":i=e.provideFunction_("math_mean",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = [e for e in myList if type(e) == int or type(e) == float]"," if not localList: return"," return float(sum(localList)) / len(localList)"])+"("+t+")";break;case"MEDIAN":i=e.provideFunction_("math_median",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = sorted([e for e in myList if type(e) == int or type(e) == float])"," if not localList: return"," if len(localList) % 2 == 0:"," return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0"," else:"," return localList[(len(localList) - 1) // 2]"])+"("+t+")";break;case"MODE":i=e.provideFunction_("math_modes",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(some_list):"," modes = []"," # Using a lists of [item, count] to keep count rather than dict",' # to avoid "unhashable" errors when the counted item is itself a list or dict.'," counts = []"," maxCount = 1"," for item in some_list:"," found = False"," for count in counts:"," if count[0] == item:"," count[1] += 1"," maxCount = max(maxCount, count[1])"," found = True"," if not found:"," counts.append([item, 1])"," for counted_item, item_count in counts:"," if item_count == maxCount:"," modes.append(counted_item)"," return modes"])+"("+t+")";break;case"STD_DEV":e.definitions_.import_math="import math",i=e.provideFunction_("math_standard_deviation",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(numbers):"," n = len(numbers)"," if n == 0: return"," mean = float(sum(numbers)) / n"," variance = sum((x - mean) ** 2 for x in numbers) / n"," return math.sqrt(variance)"])+"("+t+")";break;default:throw"Unknown operator: "+n}if(i)return[i,e.ORDER_FUNCTION_CALL]},Yr=function(t,e){var i=e.valueToCode(t,"LIST",e.ORDER_MEMBER)||"[]",n=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(n){case"FROM_START":"0"==(o=e.getAdjustedInt(t,"AT1"))&&(o="");break;case"FROM_END":var o=e.getAdjustedInt(t,"AT1",1,!0);break;case"FIRST":o="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var _=e.getAdjustedInt(t,"AT2",1);_-=1;break;case"FROM_END":_=e.getAdjustedInt(t,"AT2",1,!0);j.isNumber(String(_))?"0"==_&&(_=""):(e.definitions_.import_sys="import sys",_+=" or sys.maxsize");break;case"LAST":_="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[i+"["+o+" : "+_+"]",e.ORDER_MEMBER]},br=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0";if(1!=this.itemCount_)i="("+i.join(", ")+")";else i="("+i.join(", ")+",)";return[i,e.ORDER_ATOMIC]},Xr=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"0")+"["+(e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)||"0")+" : "+(e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)||"0")+"]",e.ORDER_ATOMIC]},yr=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"TUP",e.ORDER_ADDITIVE)||"mytup")+")",e.ORDER_ATOMIC]},Vr=function(t,e){return["tuple("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Br=function(t,e){return["("+this.getFieldValue("CONTENT")+")",e.ORDER_ATOMIC]},Gr=function(t,e){var i=e.valueToCode(this,"params",e.ORDER_ATOMIC)||"0",n=e.valueToCode(this,"des",e.ORDER_ATOMIC)||"0";return["("+i+',"'+this.getFieldValue("type")+'",'+n+")",e.ORDER_ATOMIC]},Ur=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return n=i+"= {"+n.join(", ")+"}\n",0==this.itemCount_&&(n=i+" = set()\n"),n},wr=function(t,e){return["len("+(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},kr=function(t,e){return[(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".pop()",e.ORDER_ATOMIC]},xr=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Hr=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[i+"."+this.getFieldValue("OPERATE")+"("+n+")",e.ORDER_ATOMIC]},Wr=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return i+"."+this.getFieldValue("OPERATE")+"("+n+")\n"},Kr=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("OPERATE")+"("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Jr=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[i+"."+this.getFieldValue("OPERATE")+"("+n+")",e.ORDER_ATOMIC]},Qr=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".update("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},jr=function(t,e){return["{"+this.getFieldValue("TEXT")+"}",e.ORDER_ATOMIC]},qr=function(t,e){return["set("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},zr=function(t,e){return["'''<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n"+e.statementToCode(this,"HEAD")+"</head>\n<body>\n"+e.statementToCode(this,"BODY")+"</body>\n</html>\n'''",e.ORDER_ATOMIC]},Zr=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<h"+n+">\n"+i+"</h"+n+">\n"},$r=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t<meta charset="utf-8">\n'+i+"</"+n+">\n";else s="<"+n+">\n"+i+"</"+n+">\n";return s},tp=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"</"+n+">\n"},ep=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"</"+s+">\n"},ip=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},np=function(t,e){return'<input type="'+this.getFieldValue("LEVEL")+'" name="'+this.getFieldValue("NAME")+'" value="'+this.getFieldValue("VALUE")+'" '+(e.valueToCode(this,"style")||"")+" />"},sp=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},op=function(){return this.getFieldValue("TEXT")+"\n"},_p=function(t){return t.getFieldValue("TEXT")+"\n"},up=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},rp=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},pp=function(){return""},ap=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},lp=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o<t.itemCount_;o++)s[o]=e.valueToCode(t,"ARGUMENT"+o,e.ORDER_NONE)||"___";var _=i+"("+s.join(", ")+")";return n?[_,e.ORDER_ATOMIC]:_+"\n"},Ip=function(t,e){var i=e.valueToCode(t,"MODULE",e.ORDER_ATOMIC),n=e.valueToCode(t,"NAME",e.ORDER_ATOMIC);return[i+"."+(n=n.substring(1,n.length-1)),e.ORDER_NONE]},dp={};dp.NAME_TYPE=j.PROCEDURE_CATEGORY_NAME,dp.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s<e.length;s++)if(e[s].getProcedureDef){var o=e[s].getProcedureDef();o&&(o[2]?i.push(o):n.push(o))}return n.sort(dp.procTupleComparator_),i.sort(dp.procTupleComparator_),[n,i]},dp.procTupleComparator_=function(t,e){return t[0].toLowerCase().localeCompare(e[0].toLowerCase())},dp.findLegalName=function(t,e){if(e.isInFlyout)return t;for(t=t||j.Msg.UNNAMED_KEY||"unnamed";!dp.isLegalName_(t,e.workspace,e);){var i=t.match(/^(.*?)(\d+)$/);i?t=i[1]+(parseInt(i[2],10)+1):t+="2"}return t},dp.isLegalName_=function(t,e,i){return!dp.isNameUsed(t,e,i)},dp.isNameUsed=function(t,e,i){for(var n=e.getAllBlocks(!1),s=0;s<n.length;s++)if(n[s]!=i&&n[s].getProcedureDef){var o=n[s].getProcedureDef();if(j.Names.equals(o[0],t))return!0}return!1},dp.rename=function(t){t=t.trim();var e=dp.findLegalName(t,this.getSourceBlock()),i=this.getValue();if(i!=t&&i!=e)for(var n=this.getSourceBlock().workspace.getAllBlocks(!1),s=0;s<n.length;s++)n[s].renameProcedure&&n[s].renameProcedure(i,e);return e},dp.flyoutCategory=function(t){var e,i,n=[];j.Blocks.procedures_defnoreturn&&((i=j.utils.xml.createElement("block")).setAttribute("type","procedures_defnoreturn"),i.setAttribute("gap",16),(e=j.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(j.utils.xml.createTextNode(j.Msg.PROCEDURES_DEFNORETURN_PROCEDURE)),i.appendChild(e),n.push(i));j.Blocks.procedures_defreturn&&((i=j.utils.xml.createElement("block")).setAttribute("type","procedures_defreturn"),i.setAttribute("gap",16),(e=j.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(j.utils.xml.createTextNode(j.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),i.appendChild(e),n.push(i));j.Blocks.procedures_return&&((i=j.utils.xml.createElement("block")).setAttribute("type","procedures_return"),i.setAttribute("gap",16),n.push(i));j.Blocks.procedures_ifreturn&&((i=j.utils.xml.createElement("block")).setAttribute("type","procedures_ifreturn"),i.setAttribute("gap",16),n.push(i));function s(t,e){for(var i=0;i<t.length;i++){var s=t[i][0],o=t[i][1],_=j.utils.xml.createElement("block");_.setAttribute("type",e),_.setAttribute("gap",16);var u=j.utils.xml.createElement("mutation");u.setAttribute("name",s),_.appendChild(u);for(var r=0;r<o.length;r++){var p=j.utils.xml.createElement("arg");p.setAttribute("name",o[r]),u.appendChild(p)}n.push(_)}}n.length&&n[n.length-1].setAttribute("gap",24);var o=dp.allProcedures(t);return s(o[0],"procedures_callnoreturn"),s(o[1],"procedures_callreturn"),n},dp.getCallers=function(t,e){for(var i=[],n=e.getAllBlocks(!1),s=0;s<n.length;s++)if(n[s].getProcedureCall){var o=n[s].getProcedureCall();o&&j.Names.equals(o,t)&&i.push(n[s])}return i},dp.mutateCallers=function(t){const e=j.Events.getRecordUndo(),i=t.getProcedureDef()[0],n=t.mutationToDom(!0),s=j.Procedures.getCallers(i,t.workspace);for(let t,i=0;t=s[i];i++){const i=t.mutationToDom(),s=i&&j.utils.xml.domToText(i);t.domToMutation&&t.domToMutation(n);const o=t.mutationToDom(),_=o&&j.utils.xml.domToText(o);s!==_&&(j.Events.setRecordUndo(!1),j.Events.fire(new(j.Events.get(j.Events.BLOCK_CHANGE))(t,"mutation",null,s,_)),j.Events.setRecordUndo(e))}},dp.getDefinition=function(t,e){for(var i=e.getTopBlocks(!1),n=0;n<i.length;n++)if(i[n].getProcedureDef){var s=i[n].getProcedureDef();if(s&&j.Names.equals(s[0],t))return i[n]}return null};const Tp=dp,hp=new j.Generator("Python");hp.INDENT=" ",hp.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip"),hp.ORDER_ATOMIC=0,hp.ORDER_COLLECTION=1,hp.ORDER_STRING_CONVERSION=1,hp.ORDER_UNARY_POSTFIX=1,hp.ORDER_UNARY_PREFIX=2,hp.ORDER_MEMBER=2.1,hp.ORDER_FUNCTION_CALL=2.2,hp.ORDER_EXPONENTIATION=3,hp.ORDER_UNARY_SIGN=4,hp.ORDER_BITWISE_NOT=4,hp.ORDER_MULTIPLICATIVE=5,hp.ORDER_ADDITIVE=6,hp.ORDER_BITWISE_SHIFT=7,hp.ORDER_BITWISE_AND=8,hp.ORDER_BITWISE_XOR=9,hp.ORDER_BITWISE_OR=10,hp.ORDER_RELATIONAL=11,hp.ORDER_EQUALITY=11,hp.ORDER_LOGICAL_NOT=12,hp.ORDER_LOGICAL_AND=13,hp.ORDER_LOGICAL_OR=14,hp.ORDER_ASSIGNMENT=14,hp.ORDER_CONDITIONAL=15,hp.ORDER_LAMBDA=16,hp.ORDER_NONE=99,hp.ORDER_OVERRIDES=[[hp.ORDER_FUNCTION_CALL,hp.ORDER_MEMBER],[hp.ORDER_FUNCTION_CALL,hp.ORDER_FUNCTION_CALL],[hp.ORDER_MEMBER,hp.ORDER_MEMBER],[hp.ORDER_MEMBER,hp.ORDER_FUNCTION_CALL]],hp.init=function(){hp.PASS=this.INDENT+"pass\n",hp.definitions_=Object.create(null),hp.functionNames_=Object.create(null),hp.setups_=Object.create(null),hp.loops_=Object.create(null),hp.codeEnd_=Object.create(null),hp.variableDB_?hp.variableDB_.reset():hp.variableDB_=new tt(hp.RESERVED_WORDS_)},hp.finish=function(t){""!==t&&(t=(t=t.replace(/\n/g,"\n")).replace(/\n\s+$/,"\n"));var e=[],i=[],n=[];for(var s in this.definitions_){var o=this.definitions_[s];0===s.indexOf("import")?e.push(o):0===s.indexOf("var_declare")?i.push(o):n.push(o)}e.length&&e.push("\n\n"),i.length&&i.push("\n\n"),n.length&&n.push("\n\n");var _=[];for(var s in hp.functions_)_.push(hp.functions_[s]);_.length&&_.push("\n\n");var u=[];for(var s in hp.setups_)u.push(hp.setups_[s]);u.length&&u.push("\n\n");var r=[];for(var s in hp.loops_)r.push(hp.loops_[s]);var p=[];for(var s in hp.codeEnd_)p.push(hp.codeEnd_[s]);return 0!==p.length&&p.push("\n"),r.length>0?e.join("\n")+i.join("\n")+n.join("\n")+_.join("\n")+u.join("")+t+"while True:\n"+r.join("")+p.join("\n"):e.join("\n")+i.join("\n")+n.join("\n")+_.join("\n")+u.join("")+t+p.join("\n")},hp.scrubNakedValue=function(t){return t+"\n"},hp.quote_=function(t){var e="'";return-1!==t.indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},hp.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},hp.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=j.utils.string.wrap(o,hp.COMMENT_WRAP-3),n+=hp.prefixLines(o+"\n","# "));for(var s=0;s<t.inputList.length;s++)if(t.inputList[s].type==j.INPUT_VALUE){var o,_=t.inputList[s].connection.targetBlock();if(_)(o=hp.allNestedComments(_))&&(n+=hp.prefixLines(o,"# "))}}var u=t.nextConnection&&t.nextConnection.targetBlock();return n+e+(i?"":hp.blockToCode(u))},hp.getAdjustedInt=function(t,e,i,n){var s=i||0;t.workspace.options.oneBasedIndex&&s--;var o=t.workspace.options.oneBasedIndex?"1":"0",_=s?hp.ORDER_ADDITIVE:hp.ORDER_NONE,u=hp.valueToCode(t,e,_)||o;return j.isNumber(u)?(u=parseInt(u,10)+s,n&&(u=-u)):(u=s>0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const Mp=120,mp={init:function(){this.setColour(Mp),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(j.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT).appendField(new j.FieldDropdown(mp.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(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]}))},OPERATORS:[[j.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[j.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]]},Op={init:function(){this.setColour(Mp);var t=new j.FieldDropdown(Op.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0);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){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}},OPERATORS:[[j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[j.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]]},cp="5BA5A5",Ep={init:function(){this.appendValueInput("SUB").setCheck("var"),this.setColour(cp),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET2).appendField(new j.FieldDropdown(Ep.OPERATORS),"OP"),this.appendValueInput("val").appendField(j.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.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}[e]+s}))},OPERATORS:[[j.Msg.MIXLY_UP,"shift_up"],[j.Msg.MIXLY_DOWN,"shift_down"],[j.Msg.MIXLY_LEFT,"shift_left"],[j.Msg.MIXLY_RIGHT,"shift_right"]]},Rp={init:function(){this.appendValueInput("SUB").setCheck("var"),this.setColour(cp),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(j.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new j.FieldDropdown(Rp.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":j.Msg.MIXLY_MICROBIT_image_add,"-":j.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[j.Msg.MICROBIT_DISPLAY_UNION,"add"],[j.Msg.MICROBIT_DISPLAY_MINUS,"sub"]]},gp={init:function(){this.setColour(cp),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new j.FieldDropdown(gp.OPERATORS),"OP"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.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}[e]}))},OPERATORS:[[j.Msg.MIXLY_HEIGHT,"height"],[j.Msg.MIXLY_WIDTH,"width"]]},Cp={init:function(){this.setColour(cp),this.appendValueInput("VAR").appendField(j.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_RECT).appendField(new j.FieldDropdown(Cp.STATUS),"OP"),this.jsonInit({message0:j.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(j.Msg.MIXLY_OLED_RECT)},STATUS:[[j.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[j.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},Ap={init:function(){this.setColour(cp),this.appendValueInput("VAR").appendField(j.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new j.FieldDropdown(Ap.STATUS),"OP"),this.jsonInit({message0:j.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(j.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)},STATUS:[[j.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[j.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},Lp={init:function(){this.setColour(cp),this.appendValueInput("SUB").setCheck("var").appendField(j.Msg.MSG.catOLED),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET2).appendField(new j.FieldDropdown(Lp.OPERATORS),"OP"),this.appendValueInput("val").appendField(j.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.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}[e]+s}))},OPERATORS:[[j.Msg.MIXLY_UP,"shift_up"],[j.Msg.MIXLY_DOWN,"shift_down"],[j.Msg.MIXLY_LEFT,"shift_left"],[j.Msg.MIXLY_RIGHT,"shift_right"]]},Sp="#569A98",fp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(fp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:12},(()=>new Array(32).fill(0)))},Dp={init:function(){this.setColour(Sp),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(j.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new j.FieldDropdown(Dp.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":j.Msg.MIXLY_MICROBIT_image_add,"-":j.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[j.Msg.MICROBIT_DISPLAY_UNION,"add"],[j.Msg.MICROBIT_DISPLAY_MINUS,"sub"]]},Np={init:function(){this.setColour(Sp),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET2).appendField(new j.FieldDropdown(Np.OPERATORS),"OP"),this.appendValueInput("val").appendField(j.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_UNIT);q.Boards.getSelectedBoardKey();"Python ESP32-S3"===q.JSFuncs.getPlatform()&&this.appendValueInput("boolean").appendField(j.Msg.MIXLY_synchronize+":");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),i=j.Msg.DISPLAY_IMAGE_LET,n=j.Msg.DISPLAY_IMAGE_LET2,s=j.Msg.DISPLAY_IMAGE_LET3;return i+n+{shift_up:j.Msg.MIXLY_UP,shift_down:j.Msg.MIXLY_DOWN,shift_left:j.Msg.MIXLY_LEFT,shift_right:j.Msg.MIXLY_RIGHT}[e]+s}))},OPERATORS:[[j.Msg.MIXLY_UP,"shift_up"],[j.Msg.MIXLY_DOWN,"shift_down"],[j.Msg.MIXLY_LEFT,"shift_left"],[j.Msg.MIXLY_RIGHT,"shift_right"]]},Pp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(Pp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:5},(()=>new Array(8).fill(0)))},Fp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(Fp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:8},(()=>new Array(12).fill(0)))},vp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(vp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:8},(()=>new Array(16).fill(0)))},Yp={init:function(){this.setColour(Sp),this.appendDummyInput().appendField(j.Msg.OLED_SET_FONT).appendField(new j.FieldDropdown(Yp.OPERATORS),"OP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)},OPERATORS:[["4x5"+j.Msg.MIXGO_ME_DISPLAY_HORIZONTAL,"'4x5'"],["5x5"+j.Msg.MIXGO_ME_DISPLAY_HORIZONTAL,"'5x5'"],["5x8"+j.Msg.MIXGO_ME_DISPLAY_VERTICAL,"'5x8'"]]},bp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(bp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:5},(()=>new Array(5).fill(0)))},Xp={init:function(){this.setColour(Sp),this.appendDummyInput().appendField(j.Msg.MIXLY_MIXBOT_SCREEN_ROTATE).appendField(new j.FieldDropdown(Xp.OPERATORS),"OP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)},OPERATORS:[[j.Msg.mixpy_PL_PIE_SHADOW_N,"0"],[j.Msg.CLOCKWISE+"90"+j.Msg.blockpy_setheading_degree,"1"],[j.Msg.CLOCKWISE+"180"+j.Msg.blockpy_setheading_degree,"2"],[j.Msg.CLOCKWISE+"270"+j.Msg.blockpy_setheading_degree,"3"]]},yp={init:function(){this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(j.inputs.Align.CENTRE).appendField(new j.FieldBitmap(yp.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(Sp),this.setTooltip(j.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:12},(()=>new Array(12).fill(0)))},Vp=180,Bp={init:function(){this.setColour(Vp),this.setOutput(!0),this.setInputsInline(!0),this.appendValueInput("img").appendField(j.Msg.DISPLAY_IMAGE_LET).setCheck(["esp32_image","List",String]),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_LET2).appendField(new j.FieldDropdown(Bp.OPERATORS),"OP"),this.appendValueInput("val").appendField(j.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(j.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.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}[e]+s}))},OPERATORS:[[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"]]},Gp={init:function(){this.setColour(Vp),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(j.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new j.FieldDropdown(Gp.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":j.Msg.MIXLY_MICROBIT_image_add,"-":j.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[j.Msg.MICROBIT_DISPLAY_UNION,"+"],[j.Msg.MICROBIT_DISPLAY_MINUS,"-"]]},Up={init:function(){this.setColour(Vp),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new j.FieldDropdown(Up.OPERATORS),"OP"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.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}[e]}))},OPERATORS:[[j.Msg.MIXLY_HEIGHT,"height"],[j.Msg.MIXLY_WIDTH,"width"]]},wp={init:function(){this.setColour(Vp),this.appendValueInput("VAR").appendField(j.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_RECT).appendField(new j.FieldDropdown(wp.STATUS),"OP"),this.jsonInit({message0:j.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(j.Msg.MIXLY_OLED_RECT)},STATUS:[[j.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[j.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},kp={init:function(){this.setColour(Vp),this.appendValueInput("VAR").appendField(j.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new j.FieldDropdown(kp.STATUS),"OP"),this.jsonInit({message0:j.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(j.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)},STATUS:[[j.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[j.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},xp={init:function(){this.setColour(Vp),this.appendValueInput("VAR").appendField(j.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_DISPLAY_DRAW+j.Msg.MIXLY_HANBIT_DRAW_TRIANGLE).appendField(new j.FieldDropdown(xp.STATUS),"OP"),this.jsonInit({message0:j.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(j.Msg.MIXLY_DISPLAY_DRAW+j.Msg.MIXLY_HANBIT_DRAW_TRIANGLE)},STATUS:[[j.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[j.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},Hp=225,Wp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_NETWORK_INIT),this.appendDummyInput().appendField(j.Msg.MIXLY_NETWORK_MODE).appendField(new j.FieldDropdown([["STA","STA"],["AP","AP"]]),"mode"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_INIT_TOOLTIP)}},Kp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(new j.FieldDropdown([[j.Msg.MIXLY_NETWORK_WIFI_OPEN,"True"],[j.Msg.MIXLY_NETWORK_WIFI_CLOSE,"False"]]),"op"),this.appendDummyInput("").appendField(j.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=j.Msg.MIXLY_ESP32_NETWORK_OPEN_TOOLTIP;return{True:j.Msg.MIXLY_NETWORK_WIFI_OPEN,False:j.Msg.MIXLY_NETWORK_WIFI_CLOSE}[e]+i}))}},Jp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_NETWORK_WIFI_IS_ACTIVE)}},Qp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_NETWORK_WIFI_SCAN),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip((function(){return j.Msg.MIXLY_ESP32_NETWORK_SCAN_TOOLTIP+{0:"ssid",1:"bssid",2:"channel",3:"RSSI",4:"authmode",5:"hidden",all:j.Msg.MIXLY_NETWORK_WIFI_SCAN_ATTRIBUTE}.all}))}},jp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_CONNECT),this.appendValueInput("id").setCheck(String).appendField(j.Msg.HTML_NAME),this.appendValueInput("password").setCheck(String).appendField(j.Msg.HTML_PASSWORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_CONNECT_TOOLTIP)}},qp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_NETWORK_WIFI_CONNECT+j.Msg.MIXLY_SYMBOL_QUESTION),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_WIFI_CONNECT_TOOLTIP)}},zp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_ESP32_NETWORK_IP,"0"],[j.Msg.MIXLY_ESP32_NETWORK_MASK,"1"],[j.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 j.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP+{0:j.Msg.MIXLY_ESP32_NETWORK_IP,1:j.Msg.MIXLY_ESP32_NETWORK_MASK,2:j.Msg.MIXLY_ESP32_NETWORK_GATEWAY,3:"DNS"}[e]}))}},Zp={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_STOP_CONNECT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_STOP_TOOLTIP)}},$p={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_GET_WIFI),this.appendDummyInput().appendField(new j.FieldDropdown([[j.Msg.MIXLY_NETWORK_WIFI_ESSID,"essid"],[j.Msg.MIXLY_NETWORK_WIFI_CHANNEL,"channel"]]),"op"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_GET_WIFI_TOOLTIP)}},ta={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.LISTS_SET_INDEX_SET+j.Msg.MIXLY_HOTSPOT),this.appendValueInput("essid").setCheck(String).appendField(j.Msg.MIXLY_NAME),this.appendValueInput("password").setCheck(String).appendField(j.Msg.MIXLY_EMQX_PASSWORD),this.appendValueInput("channel").setCheck(Number).appendField(j.Msg.MIXLY_NETWORK_WIFI_CHANNEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_AP_CONNECT_TOOLTIP)}},ea={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_SERVER1),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_NETWORK_SERVER2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},ia={init:function(){this.setColour(Hp),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_INIT).setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE).appendField(new j.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 j.Msg.MIXLY_ESP32_NETWORK_SOCKET_INIT_TOOLTIP+{TCP:"TCP",UDP:"UDP"}[e]}))}},na={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_BIND_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_BIND_TOOLTIP)}},sa={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_LET_SOCKET),this.appendValueInput("address").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_CONNECT_TO_ADDRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_CONNECT_TOOLTIP)}},oa={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendValueInput("queue").setCheck(Number).appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_LISTEN).appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_QUEUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_LISTEN_TOOLTIP)}},_a={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_ACCEPT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_ACCEPT_TOOLTIP)}},ua={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_READLINE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROPYTHON_SOCKET_READLINE_TOOLTIP)}},ra={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("size").setCheck(Number).appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_TOOLTIP)}},pa={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField("TCP"),this.appendValueInput("content").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TOOLTIP)}},aa={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("size").setCheck(Number).appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_RECEIVE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_RECEIVE_FROM_TOOLTIP)}},la={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var").appendField("UDP"),this.appendValueInput("content").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_SEND),this.appendValueInput("address").appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_TO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_SEND_TO_TOOLTIP)}},Ia={init:function(){this.setColour(Hp),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},da={init:function(){this.setColour(Hp),this.appendValueInput("DOMAIN").appendField(j.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(j.Msg.blockpy_REQUESTS_GET).appendField(new j.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){j.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ta={init:function(){this.appendValueInput("VAL"),this.setColour(Hp),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_GET).appendField(new j.FieldDropdown(Ta.ATTR),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:j.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:j.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:j.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))},ATTR:[[j.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[j.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[j.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[j.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]]},ha={init:function(){this.appendValueInput("VAR").appendField(j.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.setColour(Hp),this.appendDummyInput("").appendField(j.Msg.blockpy_CONDUCT).appendField(new j.FieldDropdown(ha.METHOD),"DIR"),this.appendDummyInput("").appendField(j.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:j.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:j.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))},METHOD:[["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]},Ma={init:function(){this.setColour(Hp),this.appendDummyInput("").appendField(j.Msg.MIXLY_GET_NTP+"(NTP)"),this.appendValueInput("data").appendField(j.Msg.blynk_SERVER_ADD),this.setOutput(!0,"Tuple"),this.setInputsInline(!0)}},ma={init:function(){this.setColour(Hp),this.appendDummyInput("").appendField(new j.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)}},Oa="#3288dd",ca={init:function(){this.setColour(Oa),this.appendValueInput("URL").appendField(j.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(j.Msg.blockpy_CONDUCT).appendField(new j.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(j.Msg.blockpy_REQUESTS).appendField(j.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Ea={init:function(){this.setColour(Oa),this.appendValueInput("URL").appendField(j.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(j.Msg.blockpy_CONDUCT).appendField(new j.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(j.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(j.Msg.blockpy_REQUESTS+j.Msg.OLED_STRING),this.appendDummyInput("").appendField(j.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Ra={init:function(){this.appendValueInput("VAL"),this.setColour(Oa),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_GET).appendField(new j.FieldDropdown(Ra.ATTR),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)},ATTR:[[j.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[j.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[j.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[j.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[j.Msg.MIXPY_TEXT_ENCODE,"encoding"]]},ga={init:function(){this.setColour(Oa),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_IOT_CONNECT_WIFI),this.appendValueInput("WIFINAME").setCheck(String).appendField(j.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(j.Msg.HTML_PASSWORD),this.appendValueInput("TIMEOUT").setCheck(Number).appendField(j.Msg.MIXLY_IR_TIMEOUT),this.appendDummyInput().appendField(j.Msg.MIXLY_MILLIS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},Ca={init:function(){this.setColour(Oa),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_IOT_EMQX_CONNECT_TOOLTIP),this.appendValueInput("SERVER").setCheck(String).appendField(j.Msg.MIXLY_EMQX_SERVER).setAlign(j.inputs.Align.RIGHT),this.appendValueInput("PORT").setCheck(Number).appendField(j.Msg.MIXLY_EMQX_PORT).setAlign(j.inputs.Align.RIGHT),this.appendValueInput("CLIENT_ID").setCheck(String).appendField(j.Msg.MIXLY_EMQX_CLIENT_ID).setAlign(j.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(j.Msg.MIXLY_WIFI_USERNAME).setAlign(j.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(j.Msg.MIXLY_IOT_PASSWORD).setAlign(j.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Aa={init:function(){this.setColour(Oa),this.appendValueInput("TOPIC").appendField(j.Msg.MIXLY_EMQX_SUBSCRIBE+j.Msg.MIXLY_MICROBIT_MSG).appendField(j.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MESSAGE").appendField(j.Msg.blockpy_set_of),this.setInputsInline(!0),this.setOutput(!0)}},La={init:function(){this.setColour(Oa),this.appendDummyInput().appendField("mqtt"),this.appendValueInput("TOPIC").appendField(j.Msg.MIXLY_EMQX_SUBSCRIBE+j.Msg.MIXLY_MICROBIT_MSG).appendField(j.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(j.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sa={init:function(){this.setColour(Oa),this.appendDummyInput().appendField("mqtt"),this.appendValueInput("TOPIC").appendField(j.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(j.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(j.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fa={init:function(){this.setColour(Oa),this.appendDummyInput().appendField("mqtt"+j.Msg.MIXLY_EMQX_IS_CONNECT),this.setInputsInline(!0),this.setOutput(!0)}},Da="#A58C5B",Na={init:function(){this.setColour(Da),this.appendValueInput("PIN",Number).appendField(new j.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(j.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new j.FieldDropdown(Na.METHOD),"WHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHAT");return{temperature:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[e]}))},METHOD:[[j.Msg.MIXLY_GETTEMPERATUE,"temperature"],[j.Msg.MIXLY_GETHUMIDITY,"humidity"]]},Pa={init:function(){this.setColour(Da),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250").setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_GETTEMPERATUE)}},Fa={init:function(){this.setColour(Da),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[j.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 j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},va=(j.Msg.PS2_TRIANGLE,j.Msg.PS2_CIRCLE,j.Msg.PS2_CROSS,j.Msg.PS2_SQUARE,j.Msg.PS2_L1,j.Msg.PS2_L2,j.Msg.PS2_R1,j.Msg.PS2_R2,j.Msg.PS2_UP,j.Msg.PS2_RIGHT,j.Msg.PS2_DOWN,j.Msg.PS2_LEFT,j.Msg.PS2_SELECT,j.Msg.PS2_START,{init:function(){this.setColour(Da),this.appendDummyInput("").appendField(j.Msg.PS2_stick).appendField(new j.FieldDropdown(va.PSSTK),"psstk"),this.setOutput(!0,Number),this.setTooltip("")},PSSTK:[[j.Msg.PS2_RX,"0"],[j.Msg.PS2_RY,"1"],[j.Msg.PS2_LX,"2"],[j.Msg.PS2_LY,"3"]]}),Ya={init:function(){this.setColour(Da),this.appendValueInput("SUB").appendField(j.Msg.PS2),this.appendDummyInput("").appendField(j.Msg.MIXLY_JOYSTICK).appendField(new j.FieldDropdown(Ya.PSSTK),"psstk"),this.setOutput(!0,Number),this.setTooltip("")},PSSTK:[[j.Msg.PS2_RX,"RX"],[j.Msg.PS2_RY,"RY"],[j.Msg.PS2_LX,"LX"],[j.Msg.PS2_LY,"LY"]]},ba="#947C54",Xa={init:function(){this.setColour(ba),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_IS_PRESSED)}},ya={init:function(){this.setColour(ba),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_WAS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_WAS_PRESSED)}},Va={init:function(){this.setColour(ba),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(j.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.PROCEDURES_DEFRETURN_RETURN+j.Msg.MIXLY_BUTTON+j.Msg.MIXLY_GET_PRESSES)}},Ba={init:function(){this.setColour(ba),this.appendValueInput("btn").appendField(j.Msg.MIXLY_ESP32_INTERRUPT).appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput("").appendField(j.Msg.MIXLY_MODE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[j.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[j.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(j.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},Ga={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_BUTTON),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_IS_PRESSED)}},Ua={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_BUTTON),this.appendDummyInput().appendField(j.Msg.MIXLY_WAS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_WAS_PRESSED)}},wa={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_BUTTON),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_PRESSES),this.appendValueInput("VAR").setCheck(Number).appendField(j.Msg.MIXLY_GET_PRESSES_TIME),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.PROCEDURES_DEFRETURN_RETURN+j.Msg.MIXLY_BUTTON+j.Msg.MIXLY_GET_PRESSES)}},ka={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_INTERRUPT).appendField(j.Msg.MIXLY_BUTTON),this.appendDummyInput("").appendField(j.Msg.MIXLY_MODE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_RISING,"machine.Pin.IRQ_RISING"],[j.Msg.MIXLY_FALLING,"machine.Pin.IRQ_FALLING"],[j.Msg.MIXLY_CHANGE,"(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]]),"mode"),this.appendValueInput("DO").appendField(j.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_ATTACHINTERRUPT)}},xa={init:function(){this.setColour(ba),this.appendValueInput("button").appendField(j.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_TOUCHED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_sensor_pin_pressed)}},Ha={init:function(){this.setColour(ba),this.appendValueInput("button").appendField(j.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_TOUCHED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_sensor_pin_pressed)}},Wa={init:function(){this.setColour(ba),this.appendValueInput("button").appendField(j.Msg.MIXLY_ESP32_TOUCH_SENSOR),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_TOUCHED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_sensor_pin_pressed)}},Ka={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_TOUCH_SLIDE),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOUCH_SLIDE_TOOLTIP)}},Ja={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_CHAOSHENGBO),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_CHAOSHENGBO)}},Qa={init:function(){this.setColour(ba),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCSETTIME).appendField("myRTC"),this.appendValueInput("hour").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_HOUR),this.appendValueInput("minute").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_MINUTE),this.appendValueInput("second").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!1),this.setTooltip(j.Msg.MIXLY_RTCSETTIME+j.Msg.MIXLY_MIX2)}},ja={init:function(){this.setColour(ba),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCSETDATE).appendField("myRTC"),this.appendValueInput("year").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_YEAR),this.appendValueInput("month").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_MONTH),this.appendValueInput("day").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_DAY),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.MIXLY_RTCSETDATE+j.Msg.MIXLY_MIX1)}},qa={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.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(j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_CHAOSHENGBO)}},za={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_LIGHT),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},Za={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["1","touch1"],["2","touch2"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},$a={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},tl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_UP,"12"],[j.Msg.MIXLY_DOWN,"14"],[j.Msg.MIXLY_LEFT,"13"],[j.Msg.MIXLY_RIGHT,"15"],["A","32"],["B","33"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},el={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},il={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},nl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["3","3"],["4","4"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},sl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown([["0","0"],["1","1"]]),"op"),this.setOutput(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},ol={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_EXTERN_NEAR),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_EXTERN_VALUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+j.Msg.MIXLY_ESP32_NEAR)}},_l={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"left"],[j.Msg.TEXT_TRIM_RIGHT,"right"]]),"direction").appendField(j.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=j.Msg.MIXLY_ESP32_NEAR;return i+{left:j.Msg.TEXT_TRIM_LEFT,right:j.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},ul={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0)}},rl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"l"],[j.Msg.TEXT_TRIM_RIGHT,"r"]]),"direction").appendField(j.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=j.Msg.MIXLY_ESP32_NEAR;return i+{l:j.Msg.TEXT_TRIM_LEFT,r:j.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},pl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"l"],[j.Msg.TEXT_TRIM_RIGHT,"r"]]),"direction").appendField(j.Msg.MIXLY_ESP32_EXTERN_LIGHT+j.Msg.MIXLY_DATA),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=j.Msg.MIXLY_ESP32_EXTERN_LIGHT;return i+{l:j.Msg.TEXT_TRIM_LEFT,r:j.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},al={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_ESP32_EXTERN_LIGHT+j.Msg.MIXLY_DATA),this.setOutput(!0,Number),this.setInputsInline(!0)}},ll={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_COLOR_SENSOR+j.Msg.MIXLY_DATA),this.setOutput(!0,Number),this.setInputsInline(!0)}},Il={init:function(){this.setColour(ba),this.appendDummyInput().appendField("RTC"),this.appendDummyInput().setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCGETTIME),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_ESP32_RTC_GET_TIME_TOOLTIP+" (year, month, mday, hour, minute, second, weekday, yearday)")}},dl={init:function(){this.setColour(ba),this.appendValueInput("LIST").appendField(j.Msg.MIXLY_RTCGETTIMESTAMP),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_ESP32_RTC_GET_TIMESTAMP_TOOLTIP)}},Tl={init:function(){this.setColour(ba),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(j.Msg.LISTS_TO_TUPLE),this.setInputsInline(!0),this.setOutput(!0,Number)}},hl={init:function(){this.setColour(ba),this.appendDummyInput().appendField("RTC"),this.appendValueInput("CONTENT").appendField(j.Msg.MIXLY_USE_STRING_TUPLE),this.appendDummyInput().appendField(j.Msg.MIXLY_RTCSETTIME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ml={init:function(){this.setColour(ba),this.appendDummyInput().appendField("RTC"),this.appendValueInput("year").setCheck(Number).appendField(" "+j.Msg.MIXLY_YEAR),this.appendValueInput("month").setCheck(Number).appendField(" "+j.Msg.MIXLY_MONTH),this.appendValueInput("day").setCheck(Number).appendField(" "+j.Msg.MIXLY_DAY),this.appendValueInput("hour").setCheck(Number).appendField(" "+j.Msg.MIXLY_HOUR),this.appendValueInput("minute").setCheck(Number).appendField(" "+j.Msg.MIXLY_MINUTE),this.appendValueInput("second").setCheck(Number).appendField(" "+j.Msg.MIXLY_SECOND),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(j.Msg.MIXLY_ESP32_RTC_SET_DATATIME_TOOLTIP)}},ml={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("RTC"),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_SETUP).setCheck("var"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.MIXLY_ESP32_SENSOR_RTC_INT_TOOLTIP)}},Ol={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_RTC_GET_TIME_STR),this.setOutput(!0,String),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_ESP32_RTC_GET_TIME_TOOLTIP)}},cl={init:function(){this.setColour(ba),this.appendValueInput("CONTENT").appendField(j.Msg.MIXLY_GPS_TIME+j.Msg.MIXLY_MICROBIT_TYPE_TUPLE).setCheck(),this.appendDummyInput().appendField(j.Msg.A_TO_B+j.Msg.MIXLY_GPS_TIME+j.Msg.LANG_MATH_STRING),this.setOutput(!0,String),this.setInputsInline(!0)}},El={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_LIGHT),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.ESP32_SENSOR_NIXGO_LIGHT_TOOLTIP)}},Rl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_SOUND),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.ESP32_SENSOR_NIXGO_SOUND_TOOLTIP)}},gl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_TEM_HUM+" "),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_GETTEMPERATUE,"temperature"],[j.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:j.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,humidity:j.Msg.MIXLY_ESP32C3_SENSOR_AHT_HUM_TOOLTIP}[e]}))}},Cl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Al={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_Altitude+j.Msg.MSG.catSensor+" "),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_GETPRESSURE,"pressure()"],[j.Msg.MIXLY_GETTEMPERATUE,"temperature()"],[j.Msg.MIXLY_GET_ALTITUDE,"altitude()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ll={init:function(){this.setColour(ba),this.appendDummyInput().appendField("RFID"+j.Msg.MIXLY_RFID_READ_CARD),this.appendDummyInput("").appendField(j.Msg.MIXLY_RFID_READ_CARD_UID),this.setOutput(!0,Number),this.setInputsInline(!0)}},Sl={init:function(){this.setColour(ba),this.appendDummyInput().appendField("RFID"+j.Msg.MIXLY_RFID_READ_CARD),this.appendValueInput("SECTOR").appendField(j.Msg.MIXLY_LIST_INDEX),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL),this.setOutput(!0,Number),this.setInputsInline(!0)}},fl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(j.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(j.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_COMMUNICATION_RFID_WRITE),this.appendValueInput("SECTOR").appendField(j.Msg.MIXLY_LIST_INDEX),this.appendValueInput("CONTENT").appendField(j.Msg.MIXLY_COMMUNICATION_WRITE_NUM),this.appendDummyInput().appendField(j.Msg.RETURN_SUCCESS_OR_NOT),this.setInputsInline(!0),this.setOutput(!0,Boolean)}},Nl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("RFID").appendField(new j.FieldDropdown([[j.Msg.MIXLY_RFID_SCAN_OK,"True"],[j.Msg.MIXLY_RFID_SCAN_NOTAGERR,"None"],[j.Msg.MIXLY_RFID_SCAN_ERROR,"False"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Pl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new j.FieldDropdown([["x","[0]"],["y","[1]"],["z","[2]"],["(x,y,z)",""],[j.Msg.MIXLY_STRENGTH,"strength"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{"[0]":"x","[1]":"y","[2]":"z","":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},Fl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_GET_GESTURE_ALL).appendField(new j.FieldDropdown([[j.Msg.ME_GO_PITCH,"[0]"],[j.Msg.ME_GO_ROLL,"[1]"],[j.Msg.ME_GO_PITCH+", "+j.Msg.ME_GO_ROLL,""]]),"angle"),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},vl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"]]),"gesture"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=j.Msg.MIXLY_MICROBIT_JS_CURRENT,n=j.Msg.MSG.catSensor,s=j.Msg.MIXLY_MICROBIT_JS_STATE,o=j.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down}[e]+o}))}},Yl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new j.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},bl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET+j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new j.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=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},Xl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new j.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=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},yl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},Vl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_GETTEMPERATUE)}},Bl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"strength"],[j.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 j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},Gl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField("MPU9250"),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_Reset_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},Ul={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET+j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new j.FieldDropdown([["x","[0]"],["y","[1]"],["z","[2]"],["(x,y,z)",""],[j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH_ALL,"all"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{"[0]":"x","[1]":"y","[2]":"z","":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},wl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},kl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},xl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_GETTEMPERATUE),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},Hl={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_GETTEMPERATUE),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},Wl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new j.FieldDropdown([["x","[0]"],["y","[1]"],["z","[2]"],["(x,y,z)",""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{"[0]":"x","[1]":"y","[2]":"z","":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},Kl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_GETTEMPERATUE)}},Jl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"1"],[j.Msg.TEXT_TRIM_RIGHT,"2"]]),"direction").appendField(j.Msg.MIXLY_ESP32_NEAR),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("direction"),i=j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP,n=j.Msg.MIXLY_ESP32_NEAR;return i+{left:j.Msg.TEXT_TRIM_LEFT,right:j.Msg.TEXT_TRIM_RIGHT}[e]+n}))}},Ql={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0),this.setInputsInline(!0)}},jl={init:function(){this.setColour(ba),this.appendDummyInput().appendField("acc"+j.Msg.MIXLY_MICROBIT_JS_GET).appendField(new j.FieldDropdown([[j.Msg.MIXLY_ADXL345_XA,"[0]"],[j.Msg.MIXLY_ADXL345_YA,"[1]"],[j.Msg.MIXLY_ACC_SHAKE,"[2]"],[j.Msg.MIXLY_ADXL345_XA+","+j.Msg.MIXLY_ADXL345_YA+","+j.Msg.MIXLY_ACC_SHAKE,""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION)}},ql={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"[0]"],[j.Msg.MIXGO_LEFT_MID,"[1]"],[j.Msg.MIXGO_RIGHT_MID,"[2]"],[j.Msg.TEXT_TRIM_RIGHT,"[3]"],[j.Msg.MIXLY_ALL,""]]),"key").appendField(j.Msg.MIXGO_LINE_SENSOR_VAL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+j.Msg.MIXLY_ESP32_NEAR}))}},zl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.MIXGO_LEFT_FRONT,"[0]"],[j.Msg.MIXGO_RIGHT_FRONT,"[1]"],[j.Msg.MIXGO_LEFT_BACK,"[3]"],[j.Msg.MIXGO_RIGHT_BACK,"[2]"],[j.Msg.MIXLY_ALL,""]]),"key").appendField(j.Msg.MIXGO_PROXIMITY_SENSOR),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+j.Msg.MIXLY_ESP32_NEAR}))}},Zl={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MIXGO_CAR_SENSOR_ONBOARD_CHANGE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MIXGO_CAR_SENSOR_ONBOARD_AUTO_CHANGE,"AS"],[j.Msg.MIXLY_MIXGO_CAR_USE_LINE_ONLY,"LP"],[j.Msg.MIXLY_MIXGO_CAR_USE_PROXIMITY_ONLY,"OA"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},$l={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT),this.setOutput(!0),this.setInputsInline(!0)}},tI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXGO_LINE_SENSOR).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MIXBOT_LINE_SENSOR_CALIBRATE_WHITE,"WHITE"],[j.Msg.MIXLY_MIXBOT_LINE_SENSOR_CALIBRATE_BLACK,"BLACK"],[j.Msg.MIXLY_MIXBOT_LINE_SENSOR_CALIBRATE_RESET,"RESET_TO_FAB"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},eI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new j.FieldDropdown([[j.Msg.MIXGO_LEFT_FRONT,"[0]"],[j.Msg.MIXGO_RIGHT_FRONT,"[1]"],[j.Msg.MIXGO_LEFT_BACK,"[3]"],[j.Msg.MIXGO_RIGHT_BACK,"[2]"],[j.Msg.MIXLY_ALL,""]]),"key").appendField(j.Msg.MIXGO_LINE_SENSOR_VAL),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip((function(){return j.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP+j.Msg.MIXLY_ESP32_NEAR}))}},iI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_GET+j.Msg.MIXLY_MICROBIT_Board_temperature),this.appendDummyInput(""),this.setOutput(!0,Number),this.setInputsInline(!0)}},nI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+j.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new j.FieldDropdown([["x","[0]"],["y","[1]"],["z","[2]"],["(x,y,z)",""]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{"[0]":"x","[1]":"y","[2]":"z","":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},sI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.ANALOG+j.Msg.MIXLY_ESP32_EXTERN_LIGHT),this.appendValueInput("mode").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.LCD_NUMBERING),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_LIGHT_INTENSITY+"(%)"),this.setOutput(!0,Number),this.setInputsInline(!0)}},oI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.als_num),"PIN"),this.setOutput(!0,Number)}},_I=Xa,uI=ya,rI=Va,pI=xa,aI=ul,lI=za,II=Na,dI=Fa,TI=Pa,hI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_ESP32_EXTERN_SOUND),this.setInputsInline(!0),this.setOutput(!0)}},MI={init:function(){this.setColour(ba),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_GET).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.blockpy_set_of+j.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.setInputsInline(!0),this.setOutput(!0)}},mI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_LIGHT_SENSOR),this.setInputsInline(!0),this.setOutput(!0)}},OI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_GYROSCOPE_SENSOR),this.setInputsInline(!0),this.setOutput(!0)}},cI={init:function(){this.setColour(ba),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_GET).setCheck("var"),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_Horizontal_inclination,"X"],["y","[1]"],["z","[2]"]]),"key"),this.setInputsInline(!0),this.setOutput(!0)}},EI={init:function(){this.setColour(ba),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_GET).setCheck("var"),this.appendDummyInput("").appendField(j.Msg.MIXLY_BE_SHAKED),this.setInputsInline(!0),this.setOutput(!0)}},RI={init:function(){this.setColour(ba),this.appendDummyInput("").appendField(j.Msg.MIXLY_BUTTON).appendField(new j.FieldDropdown([["a","a"],["b","b"],["c","c"]]),"btn"),this.setOutput(!0),this.setInputsInline(!0)}},gI={init:function(){this.setColour(ba),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_BUTTON),this.appendDummyInput().appendField(j.Msg.MIXLY_WAS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_WAS_PRESSED)}},CI={init:function(){this.setColour(ba),this.appendValueInput("PIN").appendField(j.Msg.MIXLY_COMMUNICATION_RFID_INITIAL),this.setOutput(!0),this.setInputsInline(!0)}},AI={init:function(){this.setColour(ba),this.appendValueInput("SUB"),this.appendDummyInput("").appendField(j.Msg.MIXLY_COMMUNICATION_RFID_READ),this.setOutput(!0),this.setInputsInline(!0)}},LI={init:function(){this.setColour(ba),this.appendValueInput("SUB").appendField(j.Msg.MIXLY_COMMUNICATION_RFID_READ+j.Msg.MIXLY_COMMUNICATION_DATA_FROM),this.appendDummyInput("").appendField(j.Msg.MIXLY_GET).appendField(new j.FieldDropdown([[j.Msg.MIXLY_SERIAL_NUMBER,"serial_number"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},SI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_GET+j.Msg.MIXLY_THE_COPROCESSOR_VERSION),this.setOutput(!0),this.setInputsInline(!0)}},fI={init:function(){this.setColour(ba),this.appendDummyInput().appendField(j.Msg.MIXLY_GET+j.Msg.ANALOG+j.Msg.MIXLY_LIGHT_SENSOR2).appendField(new j.FieldDropdown([[j.Msg.TEXT_TRIM_LEFT,"0"],[j.Msg.TEXT_TRIM_RIGHT,"1"]]),"key"),this.appendDummyInput().appendField(j.Msg.blockpy_set_of+j.Msg.MIXLY_MICROBIT_JS_SYSTEM_RAISE_VALUE),this.setOutput(!0),this.setInputsInline(!0)}},DI=40,NI={init:function(){this.setColour(DI),this.appendValueInput("PIN",Number).appendField(new j.FieldDropdown([["DHT11","dht11"],["DHT22","dht22"]]),"TYPE").appendField(j.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new j.FieldDropdown(NI.METHOD),"WHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHAT");return{temperature:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[e]}))},METHOD:[[j.Msg.MIXLY_GETTEMPERATUE,"temperature"],[j.Msg.MIXLY_GETHUMIDITY,"relative_humidity"],[j.Msg.MIXLY_DHT11_T_H,"tempandhum"]]};const PI=function(t,e){return e.definitions_.import_network="import network",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+" = network.WLAN(network."+this.getFieldValue("mode")+"_IF);\n"},FI=function(t,e){return e.definitions_.import_network="import network",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".connect("+e.valueToCode(this,"id",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"password",e.ORDER_ATOMIC)+")\n"},vI=function(t,e){return e.definitions_.import_network="import network",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".isconnected()",e.ORDER_ATOMIC]},YI=function(t,e){return e.definitions_.import_network="import network",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".ifconfig()["+this.getFieldValue("mode")+"]",e.ORDER_ATOMIC]},bI=function(t,e){return e.definitions_.import_network="import network",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".disconnect()\n"},XI=function(t,e){return e.definitions_.import_network="import network",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".active("+this.getFieldValue("op")+")\n"},yI=function(t,e){return e.definitions_.import_network="import network",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".active()",e.ORDER_ATOMIC]},VI=function(t,e){return e.definitions_.import_network="import network",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".config('"+this.getFieldValue("op")+"')",e.ORDER_ATOMIC]},BI=function(t,e){e.definitions_.import_network="import network";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"essid",e.ORDER_ATOMIC),s=e.valueToCode(this,"password",e.ORDER_ATOMIC);return i+".config(essid = "+n+", channel="+e.valueToCode(this,"channel",e.ORDER_ATOMIC)+",password="+s+")\n"},GI=function(t,e){return e.definitions_.import_network="import network",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".scan()",e.ORDER_ATOMIC]},UI=function(t,e){e.definitions_["import_server_*"]="from server import *";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"if not "+i+".isconnected():\n connectWifi(SSID, PASSWORD)\nip="+i+".ifconfig()[0]\nprint(ip)\ntime.sleep(1)\nDATA=listenData()\n"},wI=function(t,e){e.definitions_.import_network="import network",e.definitions_.import_socket="import socket";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=this.getFieldValue("mode");return"UDP"==n?n="socket.SOCK_DGRAM":"TCP"==n&&(n="socket.SOCK_STREAM"),i+" = socket.socket(socket.AF_INET, "+n+")\n"},kI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".bind("+e.valueToCode(this,"address",e.ORDER_ATOMIC)+")\n"},xI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".connect(socket.getaddrinfo"+e.valueToCode(this,"address",e.ORDER_ATOMIC)+"[0][-1])\n"},HI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".listen("+e.valueToCode(this,"queue",e.ORDER_ATOMIC)+")\n"},WI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".accept()",e.ORDER_ATOMIC]},KI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".readline()",e.ORDER_ATOMIC]},JI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".recv("+e.valueToCode(this,"size",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},QI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".send("+e.valueToCode(this,"content",e.ORDER_ATOMIC)+")\n"},jI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".recvfrom("+e.valueToCode(this,"size",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},qI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".sendto("+e.valueToCode(this,"content",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"address",e.ORDER_ATOMIC)+")\n"},zI=function(t,e){return e.definitions_.import_network="import network",e.definitions_.import_socket="import socket",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".close()\n"},ZI=function(t,e){return e.definitions_.import_requests="import requests",e.variableDB_.getName(this.getFieldValue("VAR"),j.Variables.NAME_TYPE)+"= requests.get("+e.valueToCode(this,"DOMAIN",e.ORDER_ATOMIC)+")\n"},$I=function(t,e){return e.definitions_.import_requests="import requests",[(e.valueToCode(this,"VAL",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("ATTR"),e.ORDER_ATOMIC]},td=function(t,e){return e.definitions_.import_requests="import requests","requests."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},ed=function(t,e){return e.definitions_.import_ntptime="import ntptime",["ntptime.time(host="+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},id=function(t,e){return["'"+this.getFieldValue("op")+"'",e.ORDER_ATOMIC]},nd=function(t,e){return e.definitions_.import_urequests="import urequests",["urequests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},sd=function(t,e){return e.definitions_.import_urequests="import urequests",[(e.valueToCode(this,"VAL",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("ATTR"),e.ORDER_ATOMIC]},od=function(t,e){return e.definitions_.import_urequests="import urequests",["urequests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+", data="+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},_d=function(t,e){return e.definitions_.import_educore_wifi="from educore import wifi","wifi.connect(ssid="+e.valueToCode(this,"WIFINAME",e.ORDER_ATOMIC)+", psd="+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+", timeout="+e.valueToCode(this,"TIMEOUT",e.ORDER_ATOMIC)+")\n"},ud=function(t,e){return e.definitions_.import_educore_mqttclient="from educore import mqttclient","mqttclient.connect(server="+e.valueToCode(this,"SERVER",e.ORDER_ATOMIC)+", port="+e.valueToCode(this,"PORT",e.ORDER_ATOMIC)+", client_id="+e.valueToCode(this,"CLIENT_ID",e.ORDER_ATOMIC)+", user="+e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC)+", psd="+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+")\n"},rd=function(t,e){e.definitions_.import_educore_mqttclient="from educore import mqttclient";var i=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC);return["mqttclient."+e.valueToCode(this,"MESSAGE",e.ORDER_ATOMIC)+"("+i+")",e.ORDER_ATOMIC]},pd=function(t,e){var i=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC),n=e.valueToCode(this,"METHOD",e.ORDER_ATOMIC);return e.definitions_.import_educore_mqttclient="from educore import mqttclient","mqttclient.received(topic="+i+", callback="+n+")\n"},ad=function(t,e){return e.definitions_.import_educore_mqttclient="from educore import mqttclient","mqtt_client.publish(topic="+e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC)+", content="+e.valueToCode(this,"MSG",e.ORDER_ATOMIC)+")\n"},ld=function(t,e){e.definitions_.import_educore_mqttclient="from educore import mqttclient";return["mqtt_client.connescted()",e.ORDER_ATOMIC]},Id=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+"."+e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".is_pressed()",e.ORDER_ATOMIC]},dd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+"."+e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".was_pressed()",e.ORDER_ATOMIC]},Td=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+"."+e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".get_presses("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},hd=function(t,e){e.definitions_.import_machine="import machine";var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i]="import "+i;var n=e.valueToCode(this,"btn",e.ORDER_ATOMIC),s=this.getFieldValue("mode");return i+"."+n+".irq(handler="+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger="+s+")\n"},Md=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+".button.is_pressed()",e.ORDER_ATOMIC]},md=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+".button.was_pressed()",e.ORDER_ATOMIC]},Od=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+".button.get_presses("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},cd=function(t,e){e.definitions_.import_machine="import machine";var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i]="import "+i;var n=this.getFieldValue("mode");return i+".button.irq(handler="+e.valueToCode(this,"DO",e.ORDER_ATOMIC)+", trigger="+n+")\n"},Ed=function(t,e){return e.definitions_.import_sonar="import sonar",["sonar.Sonar("+e.valueToCode(this,"PIN1",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN2",e.ORDER_ASSIGNMENT)+").checkdist()",e.ORDER_ATOMIC]},Rd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},gd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Cd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Ad=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Ld=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Sd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},fd=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},Dd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_als"]="from "+i+" import onboard_als";return["onboard_als.ps_nl()",e.ORDER_ATOMIC]},Nd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+".infrared_"+this.getFieldValue("direction")+"()",e.ORDER_ATOMIC]},Pd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_als"]="from "+i+" import onboard_als";return["onboard_als.ps()",e.ORDER_ATOMIC]},Fd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("direction");return e.definitions_["import_"+i+"_"+n]="from "+i+" import onboard_als_"+n,["onboard_als_"+n+".ps_nl()",e.ORDER_ATOMIC]},vd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_als"]="from "+i+" import onboard_als";return["onboard_als.als()",e.ORDER_ATOMIC]},Yd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_als"]="from "+i+" import onboard_als";return["onboard_als.color()",e.ORDER_ATOMIC]},bd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("direction");return e.definitions_["import_"+i+"_"+n]="from "+i+" import onboard_als_"+n,["onboard_als_"+n+".als_vis()",e.ORDER_ATOMIC]},Xd=function(t,e){return e.definitions_.import_ds18x20x="import ds18x20x",["ds18x20x.get_ds18x20_temperature("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},yd=function(t,e){return e.definitions_.import_lm35="import lm35",["lm35.get_LM35_temperature("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Vd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];if("mixgo"==i)return e.definitions_.import_mixgo="import mixgo",["mixgo.get_brightness()",e.ORDER_ATOMIC];if("mixgo_ce"==i)return e.definitions_.import_mixgo_ce="import mixgo_ce",["mixgo_ce.get_brightness()",e.ORDER_ATOMIC];if("mpython"==i)return e.definitions_.import_mpython_onboard_light="from mpython import onboard_light",["onboard_light.brightness()",e.ORDER_ATOMIC];e.definitions_["import_"+i+"_onboard_als"]="from "+i+" import onboard_als";return["onboard_als.als_vis()",e.ORDER_ATOMIC]},Bd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];if("mixbot"==i){e.definitions_["import_"+i+"_sound"]="from "+i+" import sound";var n="sound.loudness()"}else if("mixgo_zero"==i){e.definitions_.import_mixgo_zero_voice_sound_level="from mixgo_zero_voice import sound_level";n="sound_level()"}else if("mixgo_nova"==i){e.definitions_.import_mixgo_nova_voice_sound_level="from mixgo_nova_voice import sound_level";n="sound_level()"}else if("mixgo_soar"==i){e.definitions_.import_mixgo_soar_voice_sound_level="from mixgo_soar_voice import sound_level";n="sound_level()"}else{if("mixgo"==i)return e.definitions_.import_mixgo="import mixgo",["mixgo.get_soundlevel()",e.ORDER_ATOMIC];if("mpython"==i)return e.definitions_.import_mpython_onboard_sound="from mpython import onboard_sound",["onboard_sound.soundlevel()",e.ORDER_ATOMIC];if("mixgo_mini"==i){e.definitions_["import_"+i+"_onboard_bot"]="from "+i+" import onboard_bot";n="onboard_bot.soundlevel()"}else{e.definitions_["import_"+i+"_onboard_sound"]="from "+i+" import onboard_sound";n="onboard_sound.read()"}}return[n,e.ORDER_ATOMIC]},Gd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");return"mixgo_mini"==i?(e.definitions_.import_mixgo_mini_onboard_i2c="from mixgo_mini import onboard_i2c",e.definitions_.import_spl06_001="import spl06_001",e.definitions_.import_onboard_bps="onboard_bps = spl06_001.SPL06(onboard_i2c)"):e.definitions_["import_"+i+"_onboard_bps"]="from "+i+" import onboard_bps",["onboard_bps."+n,e.ORDER_ATOMIC]},Ud=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");return"mixgo_nova"==i||"mixgo_zero"==i?e.definitions_["import_"+i+"_onboard_ths"]="from "+i+" import onboard_ths":"mixgo_mini"==i?(e.definitions_.import_mixgo_mini_onboard_i2c="from mixgo_mini import onboard_i2c",e.definitions_.import_shtc3="import shtc3",e.definitions_.import_onboard_ths="onboard_ths = shtc3.SHTC3(onboard_i2c)"):e.definitions_["import_"+i+"_onboard_ths"]="from "+i+" import onboard_ths",["onboard_ths."+n+"()",e.ORDER_ATOMIC]},wd=function(t,e){return e.definitions_.import_feiyi_onboard_acc="from feiyi import onboard_acc",["onboard_acc.temperature()",e.ORDER_ATOMIC]},kd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=i,s="onboard_rfid";return"mixgo_mini"===i?(n="mini_gx",s="ext_rfid"):"mixgo_me"===i?(n="me_g1",s="ext_rc522"):"mixgo_sant"===i&&(n="sant_gx",s="ext_rfid"),e.definitions_[`import_${n}_${s}`]=`from ${n} import ${s}`,[`${s}.read_card(0, x="id")`,e.ORDER_ATOMIC]},xd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=i,o="onboard_rfid";return"mixgo_mini"===i?(s="mini_gx",o="ext_rfid"):"mixgo_me"===i?(s="me_g1",o="ext_rc522"):"mixgo_sant"===i&&(s="sant_gx",o="ext_rfid"),e.definitions_[`import_${s}_${o}`]=`from ${s} import ${o}`,[`${o}.read_card(${n}, x="content")`,e.ORDER_ATOMIC]},Hd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC),o=i,_="onboard_rfid";return"mixgo_mini"===i?(o="mini_gx",_="ext_rfid"):"mixgo_me"===i?(o="me_g1",_="ext_rc522"):"mixgo_sant"===i&&(o="sant_gx",_="ext_rfid"),e.definitions_[`import_${o}_${_}`]=`from ${o} import ${_}`,`${_}.write_card(${s}, ${n})\n`},Wd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"SECTOR",e.ORDER_ATOMIC),s=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC),o=i,_="onboard_rfid";return"mixgo_mini"===i?(o="mini_gx",_="ext_rfid"):"mixgo_me"===i?(o="me_g1",_="ext_rc522"):"mixgo_sant"===i&&(o="sant_gx",_="ext_rfid"),e.definitions_[`import_${o}_${_}`]=`from ${o} import ${_}`,[`${_}.write_card(${s}, ${n})`,e.ORDER_ATOMIC]},Kd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key"),s=i,o="onboard_rfid";return"mixgo_mini"===i?(s="mini_gx",o="ext_rfid"):"mixgo_me"===i?(s="me_g1",o="ext_rc522"):"mixgo_sant"===i&&(s="sant_gx",o="ext_rfid"),e.definitions_[`import_${s}_${o}`]=`from ${s} import ${o}`,[`${o}.scan_card() == ${n}`,e.ORDER_ATOMIC]},Jd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");if("strength"==n){if("mixbot"==i){e.definitions_["import_"+i+"_acc_gyr"]="from "+i+" import acc_gyr";var s="acc_gyr.strength()"}else if("mixgo_soar"==i){e.definitions_["import_"+i+"_onboard_imu"]="from "+i+" import onboard_imu";s="onboard_imu.strength()"}else{e.definitions_["import_"+i+"_onboard_acc"]="from "+i+" import onboard_acc";s="onboard_acc.strength()"}return[s,e.ORDER_ATOMIC]}if("mixbot"==i){e.definitions_["import_"+i+"_acc_gyr"]="from "+i+" import acc_gyr";s="acc_gyr.accelerometer()"+n}else if("mpython"==i){e.definitions_.import_mpython_motion="from mpython import motion";s="motion.accelerometer()"+n}else if("mixgo_soar"==i){e.definitions_["import_"+i+"_onboard_imu"]="from "+i+" import onboard_imu";s="onboard_imu.acceleration()"+n}else{e.definitions_["import_"+i+"_onboard_acc"]="from "+i+" import onboard_acc";s="onboard_acc.acceleration()"+n}return[s,e.ORDER_ATOMIC]},Qd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_acc"]="from "+i+" import onboard_acc",["onboard_acc.eulerangles()"+this.getFieldValue("angle"),e.ORDER_ATOMIC]},jd=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=this.getFieldValue("gesture"),n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"mpu"==n&&(e.definitions_.import_mixgo_mpu="from mixgo import mpu"),[n+'.mpu9250_is_gesture("'+i+'")',e.ORDER_ATOMIC]},qd=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=this.getFieldValue("key"),n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"mpu"==n&&(e.definitions_.import_mixgo_mpu="from mixgo import mpu"),[n+".mpu9250_get_"+i+"()",e.ORDER_ATOMIC]},zd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"button",e.ORDER_ATOMIC);if("mixgo_mini"===i||"mixgo_sant"===i||"mixgo_soar"===i){e.definitions_["import_"+i+"_onboard_bot"]="from "+i+" import onboard_bot";var s="onboard_bot.touched("+n+")"}else{e.definitions_["import_"+i]="import "+i;s=i+".touched("+n+")"}return[s,e.ORDER_ATOMIC]},Zd=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];if("mixgo_mini"===i||"mixgo_sant"===i||"mixgo_soar"===i){e.definitions_["import_"+i+"_onboard_bot"]="from "+i+" import onboard_bot";var n="onboard_bot.touch_slide()"}else{e.definitions_["import_"+i]="import "+i;n=i+".touch_slide(3, 4)"}return[n,e.ORDER_ATOMIC]},$d=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i]="import "+i,[i+"."+e.valueToCode(this,"button",e.ORDER_ATOMIC)+".is_touched()",e.ORDER_ATOMIC]},tT=function(t,e){return e.definitions_.import_mpython="import mpython",["mpython.touch_"+e.valueToCode(this,"button",e.ORDER_ATOMIC)+".is_touched()",e.ORDER_ATOMIC]},eT=function(t,e){e.definitions_.import_adxl345="import adxl345";var i,n=this.getFieldValue("key"),s=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"x"==n?i=s+".readX()":"y"==n?i=s+".readY()":"z"==n?i=s+".readZ()":"values"==n&&(i=s+".readXYZ()"),[i,e.ORDER_ATOMIC]},iT=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=this.getFieldValue("key"),n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"mpu"==n&&(e.definitions_.import_mixgo_mpu="from mixgo import mpu"),[n+".mpu9250_magnetic_"+i+"()",e.ORDER_ATOMIC]},nT=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=this.getFieldValue("key"),n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"mpu"==n&&(e.definitions_.import_mixgo_mpu="from mixgo import mpu"),[n+".mpu9250_gyro_"+i+"()",e.ORDER_ATOMIC]},sT=function(t,e){return e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_compass="from mixgo import compass",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".calibrate()\n"},oT=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"mpu"==i&&(e.definitions_.import_mixgo_mpu="from mixgo import mpu"),[i+".mpu9250_get_temperature()",e.ORDER_ATOMIC]},_T=function(t,e){e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);"compass"==i&&(e.definitions_.import_mixgo_compass="from mixgo import compass");var n,s=this.getFieldValue("compass");return"strength"==s?n=i+".get_field_strength()":"heading"==s&&(n=i+".heading()"),[n,e.ORDER_ATOMIC]},uT=function(t,e){return e.definitions_.import_mpu9250="import mpu9250",e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_compass="from mixgo import compass",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".reset_calibrate()\n"},rT=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("gesture");return e.definitions_.import_mixgo_onboard_mpu="from mixgo import onboard_mpu",['onboard_mpu.mpu9250_is_gesture("'+i+'")',e.ORDER_ATOMIC]},pT=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("key");return e.definitions_.import_mixgo_onboard_mpu="from mixgo import onboard_mpu",["onboard_mpu.mpu9250_get_"+i+"()",e.ORDER_ATOMIC]},aT=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("key");return e.definitions_.import_mixgo_onboard_mpu="from mixgo import onboard_mpu",["onboard_mpu.mpu9250_magnetic_"+i+"()",e.ORDER_ATOMIC]},lT=function(t,e){e.definitions_.import_machine="import machine";var i=this.getFieldValue("key");return e.definitions_.import_mixgo_onboard_mpu="from mixgo import onboard_mpu",["onboard_mpu.mpu9250_gyro_"+i+"()",e.ORDER_ATOMIC]},IT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_onboard_compass="from mixgo import onboard_compass","onboard_compass.calibrate()\n"},dT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_onboard_mpu="from mixgo import onboard_mpu",["onboard_mpu.mpu9250_get_temperature()",e.ORDER_ATOMIC]},TT=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_onboard_compass="from mixgo import onboard_compass";var i,n=this.getFieldValue("compass");return"strength"==n?i="onboard_compass.get_field_strength()":"heading"==n&&(i="onboard_compass.heading()"),[i,e.ORDER_ATOMIC]},hT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_mixgo_onboard_compass="from mixgo import onboard_compass","onboard_compass.reset_calibrate()\n"},MT=function(t,e){return e.definitions_.import_rtctime="import rtctime","rtctime.settime(("+e.valueToCode(this,"year",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"month",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"day",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"hour",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"minute",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"second",e.ORDER_ASSIGNMENT)+", 0, 0))\n"},mT=function(t,e){var i=e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC);return e.definitions_.import_rtctime="import rtctime","rtctime.settime("+i+")\n"},OT=function(t,e){e.definitions_.import_time="import time";return["time.localtime()",e.ORDER_ATOMIC]},cT=function(t,e){return e.definitions_.import_time="import time",["time.mktime("+e.valueToCode(this,"LIST",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ET=function(t,e){return e.definitions_.import_time="import time",["time.localtime("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},RT=function(t,e){e.definitions_.import_rtctime="import rtctime";return["rtctime.strtime()",e.ORDER_ATOMIC]},gT=function(t,e){return e.definitions_.import_rtctime="import rtctime",["rtctime.strtime("+e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},CT=function(t,e){var i=this.getFieldValue("key"),n=q.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==n)if(e.definitions_.import_mpython_magnetic="from mpython import magnetic","all"==i)var s="magnetic.getstrength()";else s="magnetic.getdata()"+i;else if("mixgo_mini"==n)if(e.definitions_.import_mixgo_mini_onboard_i2c="from mixgo_mini import onboard_i2c",e.definitions_.import_mmc5603="import mmc5603",e.definitions_.import_onboard_mgs="onboard_mgs = mmc5603.MMC5603(onboard_i2c)","all"==i)s="onboard_mgs.getstrength()";else s="onboard_mgs.getdata()"+i;else if(e.definitions_["import_"+n+"_onboard_mgs"]="from "+n+" import onboard_mgs","all"==i)s="onboard_mgs.getstrength()";else s="onboard_mgs.getdata()"+i;return[s,e.ORDER_ATOMIC]},AT=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];if("mpython"==i){e.definitions_.import_mpython_magnetic="from mpython import magnetic"}else"mixgo_mini"==i?(e.definitions_.import_mixgo_mini_onboard_i2c="from mixgo_mini import onboard_i2c",e.definitions_.import_mmc5603="import mmc5603",e.definitions_.import_onboard_mgs="onboard_mgs = mmc5603.MMC5603(onboard_i2c)"):e.definitions_["import_"+i+"_onboard_mgs"]="from "+i+" import onboard_mgs";return["onboard_mgs.getangle()",e.ORDER_ATOMIC]},LT=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];"mixgo_mini"==i?(e.definitions_.import_mixgo_mini_onboard_i2c="from mixgo_mini import onboard_i2c",e.definitions_.import_mmc5603="import mmc5603",e.definitions_.import_onboard_mgs="onboard_mgs = mmc5603.MMC5603(onboard_i2c)"):e.definitions_["import_"+i+"_onboard_mgs"]="from "+i+" import onboard_mgs";return"onboard_mgs.calibrate()\n"},ST=function(t,e){if("mixgo_mini"==q.Boards.getSelectedBoardKey().split(":")[2]){e.definitions_.import_mixgo_mini_onboard_temperature="from mixgo_mini import onboard_temperature";var i="onboard_temperature()"}else{e.definitions_.import_mixgo_me_onboard_acc="from mixgo_me import onboard_acc";i="onboard_acc.temperature()"}return[i,e.ORDER_ATOMIC]},fT=function(t,e){e.definitions_.import_mixgo_ce="import mixgo_ce";return["mixgo_ce.get_temperature()",e.ORDER_ATOMIC]},DT=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mpython_motion="from mpython import motion",["motion.gyroscope()"+i,e.ORDER_ATOMIC]},NT=function(t,e){return e.definitions_.import_mpython_motion="from mpython import motion",["motion.temperature()",e.ORDER_ATOMIC]},PT=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("direction");return e.definitions_["import_"+i+"_adc"+n]="from "+i+" import adc"+n,["adc"+n+".read()",e.ORDER_ATOMIC]},FT=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return"feiyi"==i?(e.definitions_.import_feiyi_onboard_bot51="from feiyi import onboard_bot51",["onboard_bot51.read_bat()",e.ORDER_ATOMIC]):(e.definitions_["import_"+i+"_battery"]="from "+i+" import battery",["battery.voltage()",e.ORDER_ATOMIC])},vT=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_rm_e1_gyro="from rm_e1 import gyro",["gyro.acceleration()"+i,e.ORDER_ATOMIC]},YT=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mixgocar_c3_onboard_info="from mixgocar_c3 import onboard_info",["onboard_info.patrol()"+i,e.ORDER_ATOMIC]},bT=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mixgocar_c3_onboard_info="from mixgocar_c3 import onboard_info",["onboard_info.obstacle()"+i,e.ORDER_ATOMIC]},XT=function(t,e){var i=this.getFieldValue("key");return e.definitions_.import_mixgocar_c3_onboard_info="from mixgocar_c3 import onboard_info","onboard_info.ir_mode(onboard_info."+i+")\n"},yT=function(t,e){e.definitions_.import_mixgocar_c3_onboard_info="from mixgocar_c3 import onboard_info";return["onboard_info.read_bat()",e.ORDER_ATOMIC]},VT=function(t,e){var i=this.getFieldValue("key"),n=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+n+"_patrol"]="from "+n+" import patrol","patrol.correct(patrol.CORRECTING_"+i+")\n"},BT=function(t,e){var i=this.getFieldValue("key"),n=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+n+"_patrol"]="from "+n+" import patrol",["patrol.getdata()"+i,e.ORDER_ATOMIC]},GT=function(t,e){e.definitions_.import_mixbot_acc_gyr="from mixbot import acc_gyr";return["acc_gyr.temperature()",e.ORDER_ATOMIC]},UT=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2],n=this.getFieldValue("key");if("mixgo_soar"==i){e.definitions_["import_"+i+"_onboard_imu"]="from "+i+" import onboard_imu";var s="onboard_imu.gyroscope()"+n}else{e.definitions_.import_mixbot_acc_gyr="from mixbot import acc_gyr";s="acc_gyr.gyroscope()"+n}return[s,e.ORDER_ATOMIC]},wT=function(t,e){return e.definitions_.import_feiyi_onboard_bot51="from feiyi import onboard_bot51",["onboard_bot51.read_als("+e.valueToCode(this,"mode",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},kT=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},xT=Id,HT=dd,WT=Td,KT=$d,JT=Pd,QT=Vd,jT=QT,qT=function(t,e){return e.definitions_.import_dhtx="import dhtx",["dhtx."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")."+this.getFieldValue("WHAT")+"()",e.ORDER_ATOMIC]},zT=function(t,e){e.definitions_.import_educore_sound="from educore import sound";return["sound()",e.ORDER_ATOMIC]},ZT=function(t,e){return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".read()",e.ORDER_ATOMIC]},$T=function(t,e){e.definitions_.import_educore_light="from educore import light";return["light()",e.ORDER_ATOMIC]},th=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_accelerometer"]="from "+i+" import accelerometer";return["accelerometer()",e.ORDER_ATOMIC]},eh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_accelerometer"]="from "+i+" import accelerometer",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+this.getFieldValue("key")+"()",e.ORDER_ATOMIC]},ih=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_accelerometer"]="from "+i+" import accelerometer",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".shake()",e.ORDER_ATOMIC]},nh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_button"]="from "+i+" import button",["button(button."+this.getFieldValue("btn")+")",e.ORDER_ATOMIC]},sh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_button"]="from "+i+" import button",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".status()",e.ORDER_ATOMIC]},oh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_rfid"]="from "+i+" import rfid",["rfid("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},_h=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_rfid"]="from "+i+" import rfid",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scanning()",e.ORDER_ATOMIC]},uh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_rfid"]="from "+i+" import rfid",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"."+this.getFieldValue("key")+"()",e.ORDER_ATOMIC]},rh=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"_onboard_bot"]="from "+i+" import onboard_bot";return["onboard_bot.version()",e.ORDER_ATOMIC]},ph=function(t,e){var i=q.Boards.getSelectedBoardKey().split(":")[2];return e.definitions_["import_"+i+"_onboard_bot"]="from "+i+" import onboard_bot",["onboard_bot.brightness("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},ah='<div>\r\n <h5 style="\r\n font-weight: bold;\r\n padding-bottom: 8px;\r\n user-select: text;\r\n ">{{-d.title}}</h5>\r\n <div>\r\n {{# if (d.message) { }}\r\n <p style="white-space: normal;user-select: text;padding-bottom: 5px;">\r\n {{-d.message}}\r\n </p>\r\n {{# } }}\r\n </div>\r\n</div>',{XML:lh}=q,{XML:Ih}=(lh.render(ah,{title:"烧录速度",message:"要选择烧录速度请更改“Burn Speed”此值将用于向设备烧录代码。如果在用较高的烧录速度时出现问题请尝试减小此值这可能是由于外部串行到USB芯片的限制。"}),q),{XML:dh}=(Ih.render(ah,{title:"燒錄速度",message:"要選擇燒錄速度請更改“Burn Speed”此值將用於向設備燒錄程式碼。如果在用較高的燒錄速度時出現問題請嘗試减小此值這可能是由於外部串列到USB晶片的限制。"}),q),Th=(dh.render(ah,{title:"Burn Speed",message:"To select the flashing speed, change the Burn Speed. This value will be used for flashing the code to the device. If you have issues while flashing the device at high speed, try to decrease this value. This could be due to the external serial-to-USB chip limitations."}),new j.Generator("Python"));Th.INDENT=" ",Th.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip"),Th.ORDER_ATOMIC=0,Th.ORDER_COLLECTION=1,Th.ORDER_STRING_CONVERSION=1,Th.ORDER_UNARY_POSTFIX=1,Th.ORDER_UNARY_PREFIX=2,Th.ORDER_MEMBER=2.1,Th.ORDER_FUNCTION_CALL=2.2,Th.ORDER_EXPONENTIATION=3,Th.ORDER_UNARY_SIGN=4,Th.ORDER_BITWISE_NOT=4,Th.ORDER_MULTIPLICATIVE=5,Th.ORDER_ADDITIVE=6,Th.ORDER_BITWISE_SHIFT=7,Th.ORDER_BITWISE_AND=8,Th.ORDER_BITWISE_XOR=9,Th.ORDER_BITWISE_OR=10,Th.ORDER_RELATIONAL=11,Th.ORDER_EQUALITY=11,Th.ORDER_LOGICAL_NOT=12,Th.ORDER_LOGICAL_AND=13,Th.ORDER_LOGICAL_OR=14,Th.ORDER_ASSIGNMENT=14,Th.ORDER_CONDITIONAL=15,Th.ORDER_LAMBDA=16,Th.ORDER_NONE=99,Th.ORDER_OVERRIDES=[[Th.ORDER_FUNCTION_CALL,Th.ORDER_MEMBER],[Th.ORDER_FUNCTION_CALL,Th.ORDER_FUNCTION_CALL],[Th.ORDER_MEMBER,Th.ORDER_MEMBER],[Th.ORDER_MEMBER,Th.ORDER_FUNCTION_CALL]],Th.init=function(){Th.PASS=this.INDENT+"pass\n",Th.definitions_=Object.create(null),Th.functionNames_=Object.create(null),Th.setups_=Object.create(null),Th.loops_=Object.create(null),Th.codeEnd_=Object.create(null),Th.variableDB_?Th.variableDB_.reset():Th.variableDB_=new tt(Th.RESERVED_WORDS_)},Th.finish=function(t){""!==t&&(t=(t=t.replace(/\n/g,"\n")).replace(/\n\s+$/,"\n"));var e=[],i=[],n=[];for(var s in this.definitions_){var o=this.definitions_[s];0===s.indexOf("import")?e.push(o):0===s.indexOf("var_declare")?i.push(o):n.push(o)}e.length&&e.push("\n"),i.length&&i.push("\n"),n.length&&n.push("\n");var _=[];for(var s in Th.functions_)_.push(Th.functions_[s]);_.length&&_.push("\n");var u=[];for(var s in Th.setups_)u.push(Th.setups_[s]);u.length&&u.push("\n");var r=[];for(var s in Th.loops_)r.push(Th.loops_[s]);var p=[];for(var s in Th.codeEnd_)p.push(Th.codeEnd_[s]);0!==p.length&&p.push("\n");let a="";return a=r.length>0?e.join("\n")+i.join("\n")+n.join("\n")+_.join("\n")+u.join("")+t+"while True:\n"+r.join("")+p.join("\n"):e.join("\n")+i.join("\n")+n.join("\n")+_.join("\n")+u.join("")+t+p.join("\n"),a},Th.scrubNakedValue=function(t){return t+"\n"},Th.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},Th.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Th.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=j.utils.string.wrap(o,Th.COMMENT_WRAP-3),n+=Th.prefixLines(o+"\n","# "));for(var s=0;s<t.inputList.length;s++)if(t.inputList[s].type==j.INPUT_VALUE){var o,_=t.inputList[s].connection.targetBlock();if(_)(o=Th.allNestedComments(_))&&(n+=Th.prefixLines(o,"# "))}}var u=t.nextConnection&&t.nextConnection.targetBlock();return n+e+(i?"":Th.blockToCode(u))},Th.getAdjustedInt=function(t,e,i,n){var s=i||0;t.workspace.options.oneBasedIndex&&s--;var o=t.workspace.options.oneBasedIndex?"1":"0",_=s?Th.ORDER_ADDITIVE:Th.ORDER_NONE,u=Th.valueToCode(t,e,_)||o;return j.isNumber(u)?(u=parseInt(u,10)+s,n&&(u=-u)):(u=s>0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const hh={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"]]}};hh["BBC micro:bit"]=hh.microbit;const Mh=hh,mh=100,Oh={init:function(){this.jsonInit({colour:mh,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)}},ch={init:function(){this.jsonInit({colour:mh,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"}]})}},Eh={init:function(){this.setColour(mh),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)}},Rh={init:function(){this.setColour(mh),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)}},gh={init:function(){this.jsonInit({colour:mh,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)}},Ch={init:function(){this.jsonInit({colour:mh,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"}]})}},Ah={init:function(){this.jsonInit({colour:mh,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)}},Lh={init:function(){this.setColour(mh),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)}},Sh={init:function(){this.jsonInit({colour:mh,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)}},fh={init:function(){this.setColour(mh),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)}},Dh={init:function(){this.setColour(mh),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}))}},Nh={init:function(){this.setColour(mh),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SAY),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ph={init:function(){this.setColour(mh),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_SING),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Fh={init:function(){this.setColour(mh),this.appendValueInput("VAR").setCheck(String).appendField(j.Msg.MIXLY_MICROBIT_PY_ACTUATOR_SPEECH_PRENOUNCE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},vh={init:function(){this.setColour(mh),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)}},Yh={init:function(){this.setColour(mh),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)}},bh={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(mh),this.setTooltip(""),this.setHelpUrl("")}},Xh={init:function(){this.setColour(mh),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)}},yh={init:function(){this.setColour(mh),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)}},Vh={init:function(){this.setColour(mh),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)}},Bh={init:function(){this.setColour(mh),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)}},Gh={init:function(){this.setColour(mh),this.appendDummyInput("").appendField(j.Msg.MIXLY_SETUP+" "+j.Msg.QJ00X_MP3),this.appendValueInput("RX").setAlign(j.inputs.Align.RIGHT).appendField("TX#"),this.appendValueInput("TX").setAlign(j.inputs.Align.RIGHT).appendField("RX#"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Uh=[[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 wh={init:function(){this.setColour(mh),this.appendDummyInput("").appendField(j.Msg.QJ00X_MP3),this.appendDummyInput("").appendField(j.Msg.MIXLY_STAT).appendField(new j.FieldDropdown(Uh),"CONTROL_TYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var kh=[[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 xh={init:function(){this.setColour(mh),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(kh),"LOOP_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}};var Hh=[[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 Wh={init:function(){this.setColour(mh),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(Hh),"EQ_MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(),this.setHelpUrl()}},Kh={init:function(){this.setColour(mh),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()}},Jh={init:function(){this.setColour(mh),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()}},Qh={init:function(){this.setColour(mh),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()}},jh=140,qh={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}))}},zh={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})}},Zh={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})}},$h={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"}]})}},tM={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})}},eM={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"}]})}},iM={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)}},nM={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})}},sM={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)}},oM={init:function(){this.setColour(jh),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)}},_M={init:function(){this.setColour(jh),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)}},uM={init:function(){this.setColour(jh),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)}},rM={init:function(){this.jsonInit({colour:jh,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:q.Profile.default.digital,type:"field_dropdown"},{name:"miso",options:q.Profile.default.digital,type:"field_dropdown"},{name:"sck",options:q.Profile.default.digital,type:"field_dropdown"}]}),this.setFieldValue("15","mosi"),this.setFieldValue("14","miso"),this.setFieldValue("13","sck")}},pM={init:function(){this.setColour(jh),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)}},aM=180,lM={init:function(){this.jsonInit({colour:aM,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)}},IM={init:function(){this.setColour(aM),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)}},dM={init:function(){this.setColour(aM),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)}},TM={init:function(){this.setColour(aM),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)}},hM={init:function(){this.setColour(aM),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)}},MM={init:function(){this.setColour(aM),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)}},mM={init:function(){this.setColour(aM),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)}},OM={init:function(){this.jsonInit({colour:aM,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"}]})}},cM={init:function(){this.jsonInit({colour:aM,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)}},EM={init:function(){this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.jsonInit({colour:aM,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)}},RM={init:function(){this.jsonInit({colour:aM,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"}]})}},gM={init:function(){this.setColour(aM),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}))}},CM={init:function(){this.jsonInit({colour:aM,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})}},AM={init:function(){this.jsonInit({colour:aM,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)}},LM={init:function(){this.jsonInit({colour:aM,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})}},SM={init:function(){this.jsonInit({colour:aM,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)}},fM={init:function(){this.jsonInit({colour:aM,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)}},DM={init:function(){this.jsonInit({colour:aM,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)}},NM={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(aM),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}))}},PM={init:function(){var t=[[j.Msg.MICROBIT_DISPLAY_UNION,"+"],[j.Msg.MICROBIT_DISPLAY_MINUS,"-"]];this.setColour(aM),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]}))}},FM={init:function(){this.setColour(aM),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)}},vM={init:function(){this.setColour(aM),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)}},YM={init:function(){this.setColour(aM),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)}},bM={init:function(){this.setColour(aM),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]}))}},XM={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(aM),this.setTooltip(j.Msg.MIXLY_DF_LCD+j.Msg.OLEDDISPLAY+j.Msg.MIXLY_MICROBIT_TYPE_STRING)}},yM={init:function(){var t=[[j.Msg.MIXLY_HEIGHT,"height"],[j.Msg.MIXLY_WIDTH,"width"]];this.setColour(aM),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]}))}},VM={init:function(){this.setColour(aM),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]}))}},BM="#777777",GM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField("from ").appendField(new j.FieldTextInput("microbit"),"path").appendField(" import ").appendField(new j.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField("import ").appendField(new j.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wM={init:function(){this.setColour(BM),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;e<this.arguments_.length;e++){var i=document.createElement("arg");i.setAttribute("name",this.arguments_[e]),t.appendChild(i)}return t},domToMutation:function(t){this.arguments_=[];for(var e=0;t.childNodes[e];e++){let i=t.childNodes[e];"arg"==i.nodeName.toLowerCase()&&this.arguments_.push(i.getAttribute("name"))}this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("factory_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("factory_create_with_item");s.initSvg(),s.setFieldValue(this.arguments_[n],"NAME"),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){this.arguments_=[];for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)this.arguments_.push(e.getFieldValue("NAME")),i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setAlign(j.inputs.Align.RIGHT).appendField(this.arguments_[t])}},kM={init:function(){this.setColour(BM),this.appendDummyInput().appendField(j.Msg.MIXLY_PARAMS),this.appendStatementInput("STACK"),this.contextMenu=!1}},xM={init:function(){this.setColour(BM),this.appendDummyInput().appendField(j.Msg.LISTS_CREATE_WITH_ITEM_TITLE+":").appendField(new j.FieldTextInput("x"),"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1}},HM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new j.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:wM.mutationToDom,domToMutation:wM.domToMutation,decompose:wM.decompose,compose:wM.compose,saveConnections:wM.saveConnections,updateShape_:wM.updateShape_},WM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput("test"),"NAME").appendField("=").appendField(new j.FieldTextInput("Test"),"TYPE").appendField("()"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},KM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput("test"),"NAME").appendField(".").appendField(new j.FieldTextInput("callMethod"),"METHOD"),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:wM.mutationToDom,domToMutation:wM.domToMutation,decompose:wM.decompose,compose:wM.compose,saveConnections:wM.saveConnections,updateShape_:wM.updateShape_},JM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput("test"),"NAME").appendField(".").appendField(new j.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new j.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:wM.mutationToDom,domToMutation:wM.domToMutation,decompose:wM.decompose,compose:wM.compose,saveConnections:wM.saveConnections,updateShape_:wM.updateShape_},QM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput('display.scroll("Hello World!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldTextInput("test"),"VALUE"),this.setOutput(!0)}},qM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldMultilineInput('display.scroll("Hello World!")\ndisplay.scroll("Hello Mixly!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zM={init:function(){this.setColour(BM),this.appendDummyInput("").appendField(new j.FieldMultilineInput("Hello\nMixly"),"VALUE"),this.setOutput(!0)}},ZM=20,$M={init:function(){this.setColour(ZM),this.appendDummyInput("").appendField(new j.FieldDropdown([[j.Msg.MIXLY_HIGH,"HIGH"],[j.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},tm={init:function(){this.setColour(ZM),this.appendValueInput("PIN",Number).appendField(j.Msg.MIXLY_DIGITALREAD_PIN).setCheck(Number),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_DIGITAL_READ)}},em={init:function(){this.setColour(ZM),this.appendValueInput("PIN",Number).appendField(j.Msg.MIXLY_ANALOGWRITE_PIN).setCheck(Number),this.appendValueInput("NUM",Number).appendField(j.Msg.MIXLY_VALUE2).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_WRITE_PY)}},im={init:function(){this.setColour(ZM),this.appendValueInput("PIN",Number).appendField(j.Msg.MIXLY_ANALOGWRITE_PIN).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL).appendField(new j.FieldDropdown([[j.Msg.MIXLY_mSecond,"period"],[j.Msg.MIXLY_uSecond,"period_microseconds"]]),"key"),this.appendValueInput("NUM",Number).appendField(j.Msg.MIXLY_STAT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_WRITE_SET)}},nm={init:function(){this.setColour(ZM),this.appendValueInput("PIN",Number).appendField(j.Msg.MIXLY_ANALOGREAD_PIN).setCheck(Number),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_READ)}},sm={init:function(){this.setColour(ZM),this.appendValueInput("pin").appendField(j.Msg.MIXLY_PIN),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_TOUCHED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_sensor_pin_pressed)}},om={init:function(){this.setColour(ZM),this.appendValueInput("PIN",Number).appendField(j.Msg.MIXLY_DIGITALWRITE_PIN).setCheck(Number),this.appendValueInput("STAT").appendField(j.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.LANG_INOUT_DIGITAL_WRITE_TOOLTIP)}},_m=230,um={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.digital),"PIN"),this.setOutput(!0,Number)}},rm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.analog),"PIN"),this.setOutput(!0,Number)}},pm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},am={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.pwm),"PIN"),this.setOutput(!0,Number)}},lm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.interrupt),"PIN"),this.setOutput(!0,Number)}},Im={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},dm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"microbit_image")}},Tm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.imglist),"PIN"),this.setOutput(!0)}},hm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},Mm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},mm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},Om={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},cm={init:function(){this.setColour(_m),this.appendDummyInput("").appendField(new j.FieldDropdown(q.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},Em=40,Rm={init:function(){this.setColour(Em),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_IS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_IS_PRESSED)}},gm={init:function(){this.setColour(Em),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_WAS_PRESSED),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SENOR_WAS_PRESSED)}},Cm={init:function(){this.setColour(Em),this.appendValueInput("btn").appendField(j.Msg.MIXLY_BUTTON).setCheck(Number),this.appendDummyInput().appendField(j.Msg.MIXLY_GET_PRESSES),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.PROCEDURES_DEFRETURN_RETURN+j.Msg.MIXLY_BUTTON+j.Msg.MIXLY_GET_PRESSES)}},Am={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_Current_gesture).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"],[j.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=j.Msg.MIXLY_MICROBIT_JS_CURRENT,n=j.Msg.MSG.catSensor,s=j.Msg.MIXLY_MICROBIT_JS_STATE,o=j.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down,freefall:j.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},Lm={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_WAS_GESTURE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"],[j.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=j.Msg.MIXLY_MICROBIT_JS_CURRENT,n=j.Msg.MSG.catSensor,s=j.Msg.MIXLY_MICROBIT_JS_STATE,o=j.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down,freefall:j.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},Sm={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"],[j.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(j.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=j.Msg.MIXLY_MICROBIT_JS_CURRENT,n=j.Msg.MSG.catSensor,s=j.Msg.MIXLY_MICROBIT_JS_STATE,o=j.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down,freefall:j.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},fm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"],[j.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture");return{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down,freefall:j.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]}))}},Dm={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.MIXLY_MICROBIT_JS_WAS_GESTURE).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_shake,"shake"],[j.Msg.MIXLY_UP,"up"],[j.Msg.MIXLY_DOWN,"down"],[j.Msg.MIXLY_LEFT,"left"],[j.Msg.MIXLY_RIGHT,"right"],[j.Msg.MIXLY_MICROBIT_face_up,"face up"],[j.Msg.MIXLY_MICROBIT_face_down,"face down"],[j.Msg.MIXLY_MICROBIT_freefall,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]),"gesture"),this.appendStatementInput("DO").appendField(j.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("gesture"),i=j.Msg.CONTROLS_IF_MSG_IF,n=j.Msg.MSG.catSensor,s=j.Msg.MIXLY_MICROBIT_JS_WAS_GESTURE,o=j.Msg.MIXLY_MICROBIT_PERFORMANCE;return i+n+s+{shake:j.Msg.MIXLY_MICROBIT_shake,up:j.Msg.MIXLY_UP,down:j.Msg.MIXLY_DOWN,left:j.Msg.MIXLY_LEFT,right:j.Msg.MIXLY_RIGHT,"face up":j.Msg.MIXLY_MICROBIT_face_up,"face down":j.Msg.MIXLY_MICROBIT_face_down,freefall:j.Msg.MIXLY_MICROBIT_freefall,"3g":"3g","6g":"6g","8g":"8g"}[e]+o}))}},Nm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new j.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=j.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=j.Msg.MIXLY_MICROBIT_Direction,s=j.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":j.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},Pm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_SET_ACCELERATION).appendField(new j.FieldDropdown([["1g","AcceleratorRange.OneG"],["2g","AcceleratorRange.TwoG"],["4g","AcceleratorRange.FourG"],["8g","AcceleratorRange.EightG"]]),"key"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_SET_ACCELERATION)}},Fm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_JS_GET_GESTURE,"all"],[j.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE,"current"]]),"GES").appendField(j.Msg.MIXLY_MICROBIT_JS_GESTURE),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("GES"),i=j.Msg.MIXLY_MICROBIT_JS_GET,n=j.Msg.MIXLY_MICROBIT_JS_GESTURE;return i+{all:j.Msg.MIXLY_MICROBIT_JS_GET_GESTURE,current:j.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE}[e]+n}))}},vm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Ym={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_LIGHT_LEVEL),this.setOutput(!0,Number),this.setInputsInline(!0)}},bm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS)}},Xm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_IS_COMPASS_CALIBRATED),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_IS_COMPASS_CALIBRATED1)}},ym={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setOutput(!0,Number),this.setInputsInline(!0)}},Vm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_Board_temperature),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_Board_temperature)}},Bm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS).appendField(new j.FieldDropdown([[j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,"get_field_strength"],[j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"heading"],["x","get_x"],["y","get_y"],["z","get_z"]]),"compass"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("compass");return j.Msg.MIXLY_MICROBIT_JS_GET_COMPASS+{strength:j.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH,heading:j.Msg.MIXLY_MICROBIT_JS_BY_ANGLE}[e]}))}},Gm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_ROTATION).appendField(new j.FieldDropdown([["pitch","Rotation.Pitch"],["roll","Rotation.Roll"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},Um={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_MAGETIC_FORCE).appendField(new j.FieldDropdown([["x","Dimension.X"],["y","Dimension.Y"],["z","Dimension.Z"],["strength","Dimension.Strength"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0)}},wm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_CHAOSHENGBO).appendField("Trig").appendField(new j.FieldDropdown([["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"]]),"Trig").appendField("Echo").appendField(new j.FieldDropdown([["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"]]),"Echo"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip("")}},km={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_CHAOSHENGBO).appendField("Trig").appendField(new j.FieldDropdown([["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"]]),"Trig").appendField("Echo").appendField(new j.FieldDropdown([["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"]]),"Echo"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip()}},xm={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.MIXLY_RTCINIT),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField("myRTC"),this.appendValueInput("SDA").appendField("SDA#").setCheck(Number),this.appendValueInput("SCL").appendField("SCL#").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_RTCINIT)}};var Hm=[[j.Msg.MIXLY_YEAR,"Year"],[j.Msg.MIXLY_MONTH,"Month"],[j.Msg.MIXLY_DAY,"Day"],[j.Msg.MIXLY_HOUR,"Hour"],[j.Msg.MIXLY_MINUTE,"Minute"],[j.Msg.MIXLY_SECOND,"Second"],[j.Msg.MIXLY_WEEK,"Week"],[j.Msg.MIXLY_MIX1,"Mix1"],[j.Msg.MIXLY_MIX2,"Mix2"]];const Wm={init:function(){this.setColour(Em),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCGETTIME),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField("myRTC"),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(new j.FieldDropdown(Hm),"TIME_TYPE"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TIME_TYPE");return j.Msg.MIXLY_RTCGETTIME+{Year:j.Msg.MIXLY_YEAR,Month:j.Msg.MIXLY_MONTH,Day:j.Msg.MIXLY_DAY,Hour:j.Msg.MIXLY_HOUR,Minute:j.Msg.MIXLY_MINUTE,Second:j.Msg.MIXLY_SECOND,Week:j.Msg.MIXLY_WEEK,Mix1:j.Msg.MIXLY_MIX1,Mix2:j.Msg.MIXLY_MIX2}[e]}))}},Km={init:function(){this.setColour(Em),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCSETTIME).appendField("myRTC"),this.appendValueInput("hour").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_HOUR),this.appendValueInput("minute").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_MINUTE),this.appendValueInput("second").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!1),this.setTooltip(j.Msg.MIXLY_RTCSETTIME+j.Msg.MIXLY_MIX2)}},Jm={init:function(){this.setColour(Em),this.appendDummyInput("").setAlign(j.inputs.Align.RIGHT).appendField(j.Msg.MIXLY_RTCSETDATE).appendField("myRTC"),this.appendValueInput("year").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_YEAR),this.appendValueInput("month").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_MONTH),this.appendValueInput("day").setCheck(Number).setAlign(j.inputs.Align.RIGHT).appendField(" "+j.Msg.MIXLY_DAY),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.MIXLY_RTCSETDATE+j.Msg.MIXLY_MIX1)}},Qm={init:function(){this.jsonInit({colour:Em,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/music.html#music.reset",message0:j.Msg.MIXLY_MICROBIT_Reset_COMPASS}),this.setTooltip(j.Msg.MIXLY_MICROBIT_Reset_COMPASS)}},jm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_ESP32_LIGHT),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(j.Msg.MICROBIT_SENSOR_LIGHT_TOOLTIP)}},qm={init:function(){this.setColour(Em),this.appendDummyInput().appendField(j.Msg.MIXLY_HCSR04_INIT).appendField("Trig").appendField(new j.FieldDropdown([["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"]]),"Trig").appendField("Echo").appendField(new j.FieldDropdown([["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"]]),"Echo"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}};var zm=[[j.Msg.COLOUR_RGB_RED,"0"],[j.Msg.COLOUR_RGB_GREEN,"1"],[j.Msg.COLOUR_RGB_BLUE,"2"]];const Zm={init:function(){this.setColour(Em),this.appendDummyInput("").appendField(j.Msg.TCS34725_Get_RGB).appendField(new j.FieldDropdown(zm),"TCS34725_COLOR"),this.setInputsInline(!0),this.setOutput(!0)}},$m={init:function(){this.setColour(Em),this.appendDummyInput("").appendField("NTC").appendField(j.Msg.MIXLY_TEMP),this.appendDummyInput("").appendField(j.Msg.MIXLY_PIN).appendField(new j.FieldDropdown(q.Profile.default.analog),"PIN"),this.appendValueInput("NominalResistance").setCheck(Number).appendField(j.Msg.MIXLY_NominalResistance),this.appendValueInput("betaCoefficient").setCheck(Number).appendField(j.Msg.MIXLY_betaCoefficient),this.appendValueInput("seriesResistor").setCheck(Number).appendField(j.Msg.MIXLY_seriesResistor),this.setInputsInline(!1),this.setOutput(!0,Number),this.setTooltip()}},tO=65,eO={init:function(){this.setColour(tO),this.appendValueInput("CONTENT",String).appendField("Serial "+j.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.TEXT_PRINT_TOOLTIP)}},iO={init:function(){this.setColour(tO),this.appendValueInput("CONTENT",String).appendField("Serial "+j.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.TEXT_PRINT_Huanhang_TOOLTIP+j.Msg.TEXT_PRINT_TOOLTIP)}},nO={init:function(){this.setColour(tO),this.appendValueInput("CONTENT",Number).appendField("Serial "+j.Msg.MIXLY_SERIAL_PRINT+" ("+j.Msg.MATH_HEX+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.TEXT_PRINT_HEX_TOOLTIP)}},sO={init:function(){this.setColour(tO),this.appendValueInput("char_marker").setCheck(String).appendField(j.Msg.MIXLY_MICROBIT_JS_SERIAL_WHEN_CONTAIN_DATA),this.appendStatementInput("DO").appendField(j.Msg.MIXLY_DO)}},oO={init:function(){this.setColour(tO),this.appendDummyInput().appendField("Serial "+j.Msg.MIXLY_SERIAL_READSTR),this.setOutput(!0,String),this.setTooltip(j.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_READ_STR)}},_O={init:function(){this.setColour(tO),this.appendDummyInput().appendField("Serial "+j.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Boolean),this.setTooltip(j.Msg.MIXLY_SERIAL_AVAILABLE1)}},uO={init:function(){this.setColour(tO),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_JS_SERIAL_READ_LINE),this.setOutput(!0,String),this.setTooltip(j.Msg.MIXLY_MICROBIT_JS_SERIAL_READ_LINE1)}},rO={init:function(){this.setColour(tO),this.appendDummyInput().appendField("Serial "+j.Msg.MIXLY_SERIAL_READSTR_UNTIL).appendField(new j.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)}},pO={init:function(){this.setColour(tO),this.appendValueInput("RX",Number).appendField(j.Msg.MIXLY_SETUP).appendField("RX#").setCheck(Number).setAlign(j.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(j.inputs.Align.RIGHT),this.appendDummyInput().appendField(j.Msg.MIXLY_SERIAL_BEGIN).appendField(new j.FieldDropdown([["115200","115200"],["57600","57600"],["38400","38400"],["28800","28800"],["19200","19200"],["14400","14400"],["9600","9600"]]),"baudrate"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_SERIAL_softserial)}},aO={init:function(){this.setColour(tO),this.appendDummyInput().appendField("Serial "+j.Msg.MIXLY_SERIAL_BEGIN).appendField(new j.FieldDropdown([["115200","115200"],["57600","57600"],["38400","38400"],["28800","28800"],["19200","19200"],["14400","14400"],["9600","9600"]]),"baudrate"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.LISTS_SET_INDEX_SET+j.Msg.MIXLY_SERIAL_BEGIN)}},lO={init:function(){this.setColour(tO),this.appendValueInput("VAR").appendField(j.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(j.Msg.INOUT_input_TOOLTIP)}},IO={init:function(){this.setColour(tO),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.BLOCKPY_PRINT_TOOLTIP)}},dO={init:function(){this.setColour(tO),this.appendValueInput("VAR").appendField(j.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(j.Msg.TEXT_PRINT_TOOLTIP)}},TO=120,hO={init:function(){this.setColour(TO),this.appendValueInput("DELAY_TIME",Number).appendField(j.Msg.MIXLY_DELAY+"("+j.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},MO={init:function(){this.setColour(TO),this.appendDummyInput().appendField(j.Msg.MIXLY_RUNTIME+"("+j.Msg.MIXLY_MILLIS+")"),this.setOutput(!0,Number),this.setTooltip(j.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},mO={init:function(){this.setColour(TO),this.appendValueInput("STATUS_CODE",Number).appendField(j.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_Panic_with_status_code)}},OO={init:function(){this.setColour(TO),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0),this.setTooltip(j.Msg.MIXLY_MICROBIT_Reset_micro)}},cO={init:function(){this.setColour(TO),this.appendDummyInput().appendField(j.Msg.MIXLY_MICROBIT_PY_CONTORL_UNAME),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(j.Msg.PROCEDURES_DEFRETURN_RETURN+j.Msg.MIXLY_MICROBIT_PY_CONTORL_UNAME)}},EO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music","music.play(music."+t.getFieldValue("melody")+", pin=pin"+e.valueToCode(t,"PIN",e.ORDER_ATOMIC)+", wait="+("TRUE"==t.getFieldValue("wait")?"True":"False")+", loop="+("TRUE"==t.getFieldValue("loop")?"True":"False")+")\n"},RO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music","music.play(music."+t.getFieldValue("melody")+", pin=pin"+e.valueToCode(t,"PIN",e.ORDER_ATOMIC)+")\n"},gO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music",e.definitions_.import_math="import math","music.pitch(round("+e.valueToCode(t,"pitch",e.ORDER_ATOMIC)+"), round("+e.valueToCode(t,"duration",e.ORDER_ATOMIC)+"), pin"+e.valueToCode(t,"PIN",e.ORDER_ATOMIC)+", wait = "+("TRUE"==t.getFieldValue("wait")?"True":"False")+")\n"},CO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music",e.definitions_.import_math="import math","music.pitch(round("+e.valueToCode(t,"pitch",e.ORDER_ATOMIC)+"), pin=pin"+e.valueToCode(t,"PIN",e.ORDER_ATOMIC)+")\n"},AO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music";var i=e.valueToCode(t,"PIN",e.ORDER_ATOMIC);return"music.play("+(e.valueToCode(t,"notes",e.ORDER_ATOMIC)||"[]")+", pin=pin"+i+", wait="+("TRUE"==t.getFieldValue("wait")?"True":"False")+", loop="+("TRUE"==t.getFieldValue("loop")?"True":"False")+")\n"},LO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music";return"music.reset()\n"},SO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music","music.stop(pin"+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")\n"},fO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_music="import music";return["music.get_tempo()",e.ORDER_ATOMIC]},DO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"BPM",e.ORDER_ASSIGNMENT);return"music.set_tempo(ticks="+e.valueToCode(this,"TICKS",e.ORDER_ASSIGNMENT)+", bpm="+i+")\n"},NO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_speech="import speech",["speech.translate("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},PO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_speech="import speech","speech."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+", pitch="+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+", speed="+e.valueToCode(this,"speed",e.ORDER_ATOMIC)+", mouth="+e.valueToCode(this,"mouth",e.ORDER_ATOMIC)+", throat="+e.valueToCode(this,"throat",e.ORDER_ATOMIC)+")\n"},FO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_speech="import speech","speech.say("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},vO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_speech="import speech","speech.sing("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},YO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_speech="import speech","speech.pronounce("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},bO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_Servolib="import Servo";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"DEGREE",e.ORDER_ATOMIC);if(isNaN(parseInt(i)))s="Servo.angle("+i+", "+n+")\n";else var s="Servo.angle(pin"+i+", "+n+")\n";return s},XO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_motor_control="import motor_control","motor_control.MotorRun("+this.getFieldValue("Motor")+", "+this.getFieldValue("mode")+e.valueToCode(this,"speed",e.ORDER_ATOMIC)+")\n"},yO=function(t,e){var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"LEDCOUNT",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel",e.setups_["var_rgb_display"+i]="np = neopixel.NeoPixel(pin"+i+", "+n+")\n",""},VO=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","np["+i+"] = ("+n+", "+s+", "+o+")\n"},BO=function(t,e){var i=e.valueToCode(this,"_LED_",e.ORDER_ATOMIC),n=this.getFieldValue("RGB_LED_COLOR");e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel";var s="np["+i+"] = ("+n+")\n";return s+="np.show()\n"},GO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_neopixel="import neopixel";return"np.show()\n"},UO=function(t,e){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),e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3 = QJ00X_MP3(mp3_rx="+i+", mp3_tx="+n+")\n"},wO=function(t,e){var i=this.getFieldValue("CONTROL_TYPE");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3."+i+"()\n"},kO=function(t,e){var i=this.getFieldValue("LOOP_MODE");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3.set_loop("+i+")\n"},xO=function(t,e){var i=this.getFieldValue("EQ_MODE");return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3.set_eq("+i+")\n"},HO=function(t,e){var i=e.valueToCode(this,"vol",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3.set_vol("+i+")\n"},WO=function(t,e){var i=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3.playFileByIndexNumber("+i+")\n"},KO=function(t,e){var i=e.valueToCode(this,"FOLDER",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_QJ00X_MP3="from MP3 import QJ00X_MP3","mp3.set_folder("+i+", "+n+")\n"},JO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio","radio."+this.getFieldValue("type")+"()\n"},QO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio";return"radio.on()\n"},jO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio";return"radio.off()\n"},qO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio","radio.config(length="+e.valueToCode(this,"length",e.ORDER_ATOMIC)+", queue="+e.valueToCode(this,"queue",e.ORDER_ATOMIC)+", channel="+e.valueToCode(this,"channel",e.ORDER_ATOMIC)+", power="+e.valueToCode(this,"power",e.ORDER_ATOMIC)+", address="+e.valueToCode(this,"address",e.ORDER_ATOMIC)+", group="+e.valueToCode(this,"group",e.ORDER_ATOMIC)+", data_rate=radio."+e.valueToCode(this,"data_rate",e.ORDER_ATOMIC)+")\n"},zO=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio";return"radio.reset()\n"},ZO=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio","radio."+this.getFieldValue("type")+"("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")\n"},$O=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio",["radio."+this.getFieldValue("type")+"()",e.ORDER_ATOMIC]},tc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_radio="import radio";return["radio.receive()",e.ORDER_ATOMIC]},ec=function(t,e){var i=e.valueToCode(this,"RX",e.ORDER_ATOMIC),n=e.valueToCode(this,"TX",e.ORDER_ATOMIC),s=e.valueToCode(this,"freq",e.ORDER_ATOMIC);return isNaN(parseInt(i))||(i="pin"+i),isNaN(parseInt(n))||(n="pin"+n),"i2c.init(sda="+i+", scl="+n+", freq="+s+")\n"},ic=function(t,e){var i=e.valueToCode(this,"address",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ATOMIC),s=this.getFieldValue("is_repeated");return["i2c.read("+i+", "+n+", "+(s=s.substring(0,1).toUpperCase()+s.substring(1).toLowerCase())+")",e.ORDER_ATOMIC]},nc=function(t,e){var i=e.valueToCode(this,"address",e.ORDER_ATOMIC),n=e.valueToCode(this,"data",e.ORDER_ATOMIC),s=this.getFieldValue("is_repeated");return"i2c.write("+i+", "+n+", "+(s=s.substring(0,1).toUpperCase()+s.substring(1).toLowerCase())+")\n"},sc=function(t){return"spi.init(baudrate="+t.getFieldValue("freq")+", bits="+t.getFieldValue("bits")+", mode="+t.getFieldValue("mode")+", mosi="+t.getFieldValue("mosi")+", miso= "+t.getFieldValue("miso")+", sclk="+t.getFieldValue("sck")+");\n"},oc=function(t,e){return["spi.write("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},_c=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return"display.clear()\n"},uc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.get_pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},rc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.set_pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"), "+e.valueToCode(t,"value",e.ORDER_ATOMIC)+")\n"},pc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.set_pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"brightness",e.ORDER_ASSIGNMENT)+")\n"},ac=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},lc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},Ic=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+", delay="+e.valueToCode(this,"delay",e.ORDER_ASSIGNMENT)+")\n"},dc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.show("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")\n"},Tc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.show("+("Image."+t.getFieldValue("image"))+")\n"},hc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.show("+e.valueToCode(t,"images",e.ORDER_ATOMIC)+", delay="+e.valueToCode(t,"delay",e.ORDER_ATOMIC)+", wait="+("TRUE"==t.getFieldValue("wait")?"True":"False")+", loop="+("TRUE"==t.getFieldValue("loop")?"True":"False")+", clear="+("TRUE"==t.getFieldValue("clear")?"True":"False")+")\n"},Mc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.scroll("+e.valueToCode(t,"message",e.ORDER_ATOMIC)+")\n"},mc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display."+t.getFieldValue("on_off")+"()\n"},Oc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["display.is_on()",e.ORDER_ATOMIC]},cc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["Image."+t.getFieldValue("image"),e.ORDER_ATOMIC]},Ec=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(t,"image",e.ORDER_ATOMIC)+".copy()",e.ORDER_ATOMIC]},Rc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(t,"image",e.ORDER_ATOMIC)+".invert()",e.ORDER_ATOMIC]},gc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i={"#000000":"0","#440000":"1","#660000":"2","#880000":"3","#aa0000":"4","#bb0000":"5","#cc0000":"6","#dd0000":"7","#ee0000":"8","#ff0000":"9"};return['Image("'+i[t.getFieldValue("00")]+i[t.getFieldValue("01")]+i[t.getFieldValue("02")]+i[t.getFieldValue("03")]+i[t.getFieldValue("04")]+":"+i[t.getFieldValue("10")]+i[t.getFieldValue("11")]+i[t.getFieldValue("12")]+i[t.getFieldValue("13")]+i[t.getFieldValue("14")]+":"+i[t.getFieldValue("20")]+i[t.getFieldValue("21")]+i[t.getFieldValue("22")]+i[t.getFieldValue("23")]+i[t.getFieldValue("24")]+":"+i[t.getFieldValue("30")]+i[t.getFieldValue("31")]+i[t.getFieldValue("32")]+i[t.getFieldValue("33")]+i[t.getFieldValue("34")]+":"+i[t.getFieldValue("40")]+i[t.getFieldValue("41")]+i[t.getFieldValue("42")]+i[t.getFieldValue("43")]+i[t.getFieldValue("44")]+'")',e.ORDER_ATOMIC]},Cc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";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]},Ac=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=t.getFieldValue("OP"),n=e.valueToCode(t,"A",e.ORDER_ATOMIC),s=e.valueToCode(t,"B",e.ORDER_ATOMIC);if("INTERSECTION"==i)var o=n+"-("+n+"-"+s+")";else o=n+i+s;return[o,e.ORDER_ATOMIC]},Lc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","display.scroll("+(e.valueToCode(t,"images",e.ORDER_ATOMIC)||"hello")+", delay="+e.valueToCode(t,"delay",e.ORDER_ATOMIC)+", wait="+("TRUE"==t.getFieldValue("wait")?"True":"False")+", loop="+("TRUE"==t.getFieldValue("loop")?"True":"False")+", clear="+("TRUE"==t.getFieldValue("clear")?"True":"False")+")\n"},Sc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_lcd1602="import lcd1602","mylcd.mixly_puts_two_lines("+e.valueToCode(this,"TEXT",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"TEXT2",e.ORDER_ASSIGNMENT)+")\n"},fc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_lcd1602="import lcd1602","mylcd = lcd1602.LCD1602("+(e.valueToCode(this,"device",e.ORDER_ASSIGNMENT)||"0x27")+")\n"},Dc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_lcd1602="import lcd1602";var i=e.valueToCode(this,"TEXT",e.ORDER_ASSIGNMENT)||'String("")',n=e.valueToCode(this,"row",e.ORDER_ASSIGNMENT)||"1";return"mylcd.mixly_puts("+i+", "+(e.valueToCode(this,"column",e.ORDER_ASSIGNMENT)||"1")+", "+n+")\n"},Nc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_lcd1602="import lcd1602","mylcd."+this.getFieldValue("STAT")+"\n"},Pc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_oled="import oled","mixly_oled_text("+(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"},Fc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return["Image."+this.getFieldValue("OP")+"("+i+")",e.ORDER_ATOMIC]},vc=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_oled="import oled",i+".show_fill("+this.getFieldValue("key")+")\n"},Yc=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},bc=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},Xc=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return i+"("+n.join(", ")+")\n"},yc=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return[i+"("+n.join(", ")+")",e.ORDER_ATOMIC]},Vc=function(t,e){var i=this.getFieldValue("TYPE"),n=this.getFieldValue("NAME");return e.setups_["var_"+i+"_"+n]=n+" = "+i+"()\n",""},Bc=function(t,e){for(var i=this.getFieldValue("NAME"),n=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),o=0;o<this.itemCount_;o++)s[o]=e.valueToCode(this,"ADD"+o,e.ORDER_NONE)||"";return i+"."+n+"("+s.join(", ")+")\n"},Gc=function(t,e){for(var i=this.getFieldValue("NAME"),n=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),o=0;o<this.itemCount_;o++)s[o]=e.valueToCode(this,"ADD"+o,e.ORDER_NONE)||"";return[i+"."+n+"("+s.join(", ")+")",e.ORDER_ATOMIC]},Uc=function(){return this.getFieldValue("VALUE")+"\n"},wc=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},kc=function(){return this.getFieldValue("VALUE")+"\n"},xc=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},Hc=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},Wc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i="";return i+="pin"+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write_digital("+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},Kc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["pin"+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".read_digital()",e.ORDER_ATOMIC]},Jc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","pin"+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".write_analog("+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},Qc=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";var i=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),n=e.valueToCode(this,"NUM",e.ORDER_ATOMIC);return"pin"+i+".set_analog_"+this.getFieldValue("key")+"("+n+")\n"},jc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["pin"+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+".read_analog()",e.ORDER_ATOMIC]},qc=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["pin"+e.valueToCode(this,"pin",e.ORDER_ATOMIC)+".is_touched()",e.ORDER_ATOMIC]},zc=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Zc=zc,$c=zc,tE=zc,eE=zc,iE=zc,nE=zc,sE=zc,oE=zc,_E=zc,uE=zc,rE=zc,pE=zc,aE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".is_pressed()",e.ORDER_ATOMIC]},lE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".was_pressed()",e.ORDER_ATOMIC]},IE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",[e.valueToCode(this,"btn",e.ORDER_ATOMIC)+".get_presses()",e.ORDER_ATOMIC]},dE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['"'+this.getFieldValue("gesture")+'"',e.ORDER_ATOMIC]},TE=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)},hE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.is_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},ME=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",['accelerometer.was_gesture("'+this.getFieldValue("gesture")+'")',e.ORDER_ATOMIC]},mE=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)},OE=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]},cE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.current_gesture()",e.ORDER_ATOMIC]},EE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["accelerometer.get_"+this.getFieldValue("key")+"()",e.ORDER_ATOMIC]},RE=function(){return"input.setAccelerometerRange("+this.getFieldValue("key")+")\n"},gE=function(t,e){return["input.lightLevel()",e.ORDER_ATOMIC]},CE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.calibrate()\n"},AE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.is_calibrated()",e.ORDER_ATOMIC]},LE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass.heading()",e.ORDER_ATOMIC]},SE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["temperature()",e.ORDER_ATOMIC]},fE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["compass."+this.getFieldValue("compass")+"()",e.ORDER_ATOMIC]},DE=function(t,e){return["input.rotation("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},NE=function(t,e){return["input.magneticForce("+this.getFieldValue("key")+")",e.ORDER_ATOMIC]},PE=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]},FE=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]},vE=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *",e.definitions_.import_RTC="from RTC import *"},YE=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]}},bE=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"},XE=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"},yE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","compass.clear_calibration()\n"},VE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["display.read_light_level()",e.ORDER_ATOMIC]},BE=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"},GE=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]},UE=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]},wE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+"))\n"},kE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.write(str("+(e.valueToCode(this,"CONTENT",e.ORDER_ATOMIC)||'""')+")+'\\r\\n')\n"},xE=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"},HE=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"},WE=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.any()",e.ORDER_ATOMIC]},KE=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.read()",e.ORDER_ATOMIC]},JE=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["uart.readline()",e.ORDER_ATOMIC]},QE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["serial.readUntil("+this.getFieldValue("char_marker")+")",e.ORDER_ATOMIC]},jE=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"},qE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","uart.init(baudrate="+this.getFieldValue("baudrate")+")\n"},zE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *",["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},ZE=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},$E=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},tR=function(t,e){return"control.inBackground(() => {\n"+e.statementToCode(this,"do")+"})\n"},eR=function(){return"control.reset()\n"},iR=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||q.Profile.default.serial)+")\n"},nR=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||q.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||q.Profile.default.serial)+")\n"},sR=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||q.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||q.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},oR=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},_R=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},uR=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},rR=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},pR=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},aR=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},lR=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},IR=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},dR=function(t,e){e.definitions_["import_microbit_*"]="from microbit import *";return["running_time()",e.ORDER_ATOMIC]},TR=function(){return"while True:\n pass\n"},hR=function(t,e){return e.definitions_["import_microbit_*"]="from microbit import *","reset()\n"},MR=function(t,e){return e.definitions_.import_os="import os",["os.uname()",e.ORDER_ATOMIC]};Object.assign(j.Variables,Z),Object.assign(j.Procedures,Tp),j.Python=hp,j.generator=hp,q.Profile.default={},Object.assign(q.Profile,Mh),Object.assign(q.Profile.default,Mh.microbit),Object.assign(j.Blocks,e,i,n,s,o,_,u,r,p,a,l,I,d,f,D,F,v,Y,b,X,y,V,B,G),Object.assign(j.Python.forBlock,T,h,M,m,O,c,E,R,g,C,A,L,S,N,P,U,w,k,x,H,W,K,J,Q)})();